Large floats displayed as "0," in some locales
----------------------------------------------
Key: JRUBY-917
URL: http://jira.codehaus.org/browse/JRUBY-917
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Environment: OS X 10.4.9, Java 1.5.0_07
Reporter: Anders Bengtsson
Attachments: float_locale.patch
For (negative?) floats larger than some value RubyFloat uses Java's float
formatting and then parses the result. Java's formatting is in some cases
locale-sensitive, causing it to break for locales which uses "," as a decimal
separator. The resulting string becomes just "0,".
This was causing a failture in the test/rubicon/test_float.rb test, as reported
on jruby-dev by Steen Leehman.
I've fixed it by forcing the used DecimalFormat to the Locale.ENGLISH locale.
After fixing this, the tests ran a bit further, uncovering a similar problem
with dates in test/test_primitive_to_java.rb, but this time in the test itself.
This was also fixed by forcing the locale.
(I can't recall having this problem on Linux with a Swedish locale, so I
suspect it's specific to how Java's locales works on OS X.)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email