BigDecimal to_s displays incorrect number when number has no whole part
-----------------------------------------------------------------------
Key: JRUBY-1151
URL: http://jira.codehaus.org/browse/JRUBY-1151
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.0.0
Reporter: Nils Olryd
Attachments: RubyBigDecimal.java, testBigDecimal.rb
The statement puts BigDecimal("0.23") prints "2.3". This is due to the way the
whole and fraction part are constructed in to_s, based on the unscaled value.
The unscaled value should have a leading 0 in order for the to_s function to
work correctly. Included is the RubyBigDecimal.java file with a simple
modification. Also included is the testBigDecimal.rb file with cases added for
positive and negative numbers with 0 wholes.
--
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