[pypy-svn] r55538 - pypy/branch/js-refactoring/pypy/lang/js

fijal at codespeak.net fijal at codespeak.net
Tue Jun 3 23:25:51 CEST 2008


Author: fijal
Date: Tue Jun  3 23:25:50 2008
New Revision: 55538

Modified:
   pypy/branch/js-refactoring/pypy/lang/js/jsobj.py
Log:
Hack to make printing floats correct.


Modified: pypy/branch/js-refactoring/pypy/lang/js/jsobj.py
==============================================================================
--- pypy/branch/js-refactoring/pypy/lang/js/jsobj.py	(original)
+++ pypy/branch/js-refactoring/pypy/lang/js/jsobj.py	Tue Jun  3 23:25:50 2008
@@ -489,8 +489,11 @@
                 return str(intval)
         except OverflowError:
             pass
-        
-        return str(self.floatval)
+
+        res = str(self.floatval)
+        if (res[-3] == '+' or res[-3] == '-') and res[-2] == '0':
+            res = res[:-2] + res[-1]
+        return res
     
     def ToBoolean(self):
         if isnan(self.floatval):



More information about the Pypy-commit mailing list