I'm having problems rounding. I have a float, which I want to round to the hundredth of a decimal. However, I can only use .round
which basically turns it into an int, meaning 2.34.round # => 2.
Is there a simple effect way to do something like 2.3465 # => 2.35
Pass an argument to round containing the number of decimal places to round to
>> 2.3465.round
=> 2
>> 2.3465.round(2)
=> 2.35
>> 2.3465.round(3)
=> 2.347