I am seeing very, VERY strange behavior when I run certain reports:
>> p = BigDecimal.new('0.1785990254E5')
=> #<BigDecimal:b649b978,'0.1785990254E5',16(16)>
>> q = BigDecimal.new('0.76149149E4')
=> #<BigDecimal:b64968d8,'0.76149149E4',8(16)>
>> p-q
=> #<BigDecimal:b6495ab4,'0.124498764E5',16(32)>
>> p.to_s
=> "17859.90254"
>> q.to_s
=> "7614.9149"
>> (p-q).to_s
=> "10244.98764"
If you notice, p.to_s and the BigDecimal's representation look consistent. Same with q and q.to_s. However, (p-q) has the string represented as '0.1244...' but comes out when formatted as "10244.98..." When I run this through 'number_to_currency' it actually displays the wrong number ($12,449.88) rather than the expected number--BUT ONLY on my RHEL 4 Box