2 Decimal Places Ruby
number = 1.1164
number.round(2)
Or
sprintf('%.2f', number)
Zagham Abbas
number = 1.1164
number.round(2)
Or
sprintf('%.2f', number)
sprintf('%.2f', 53) # => "53.00"