How do you round a float to 2 decimal places in JRuby?

How do you round a float to 2 decimal places in JRuby(1.6.x)?

number = 1.1164
number.round(2)

# The above shows the following error
# wrong number of arguments (1 for 0)

6 Answers
6

Leave a Comment