KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
As far as I understand the .round() -functionality in ruby rounds decimals upwards where the last significant number is 5 ? For example 1.5.round(0) # => 2 (OK) but why does 1.025.round(2) # => 1.02 , and not 1.03 as I would expect? irb(main):037:0> 1.025.round(2) => 1.02 What can I do to go around this?
Tags (comma-separated)
Save Edits
Cancel