Closed deepj closed 2 years ago
Since Ruby 2.4, sprintf('%.2f') returns a different accuracy.
sprintf('%.2f')
MRI (2.5.3)
sprintf('%.2f', '1.025') # => "1.02"
TruffleRuby (1.0.0-rc10)
sprintf('%.2f', '1.025') # => "1.03"
It's not inaccurate - it's rounding incorrectly.
Fixed in c99ec964fb51f8364c6919467e898db6969f4058. Thank you for reporting.
Since Ruby 2.4,
sprintf('%.2f')
returns a different accuracy.MRI (2.5.3)
TruffleRuby (1.0.0-rc10)