Browse Source

Fixing ToNumberString

Sebastien Ros 11 years ago
parent
commit
ec108f5bdf
2 changed files with 1 additions and 9 deletions
  1. 1 8
      Jint/Native/Number/NumberPrototype.cs
  2. 0 1
      README.md

+ 1 - 8
Jint/Native/Number/NumberPrototype.cs

@@ -211,14 +211,7 @@ namespace Jint.Native.Number
                 return ToNumberString(x);    
             }
 
-            const string format = "0.00000000000000000e0";
-            var parts = x.ToString(format, CultureInfo.InvariantCulture).Split('e');
-            var s = parts[0].TrimEnd('0').Replace(".", "");
-            var n = int.Parse(parts[1]) + 1;
-
-            var integerPart = s.Substring(0, n);
-            
-            var integer = long.Parse(integerPart);
+            var integer = (long) x;
             var fraction = x -  integer;
 
             string result = ToBase(integer, radix);

+ 0 - 1
README.md

@@ -86,7 +86,6 @@ If you need to pass a JavaScript callback to the CLR, then it will be converted
 
 - Fix remaining SunSpider scripts
   - crypto-aes
-  - string-unpack-code
   - 3d-raytrace