BigDecimal.to_s('F') does not match MRI, generates bogus formatting
-------------------------------------------------------------------
Key: JRUBY-2567
URL: http://jira.codehaus.org/browse/JRUBY-2567
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.1.1
Environment: jruby 1.1.1, comparing with MRI 1.8.6, OS X 10.5.2,
Powerbook
Reporter: Paul Cantrell
JRuby's BigDecimal.to_s('F') generates output that does not match MRI, and does
not parse as a valid number. Compare:
{quote}
odysseus (~)$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]
odysseus (~)$ irb
>> require 'bigdecimal'
=> true
>> BigDecimal.new('3000').to_s('F')
=> {color:red}"3000.0"{color}
{quote}
{quote}
odysseus (~)$ jruby -v
ruby 1.8.6 (2008-04-22 rev 6555) [ppc-jruby1.1.1]
odysseus (~)$ jruby -S irb
irb(main):001:0> require 'bigdecimal'
=> true
irb(main):002:0> BigDecimal.new('3000').to_s('F')
=> {color:red}"3E+3.0"{color}
{quote}
This is currently breaking the JDBC Postgres adaptor, and possibly other JDBC
adaptors as well. They rely on to_s('F') working correctly, and JRuby's bogus
format causes DB errors on inserts and updates of decimal columns in Rails.
--
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