0

I stumbled upon a very weird behaviour. A normal bigdecimal value when converted to string using to_s method changes it's behaviour.

There is a normal float column in my table and a record has the value 37502

When I fetch the record and print it in view using

"some text "+ my_record.amount.to_s

I get the output as

37502.0390625

I am perplexed with this behaviour

ZX12R
  • 4,760
  • 8
  • 38
  • 53

0 Answers0