method

round

v1_9_1_378 - Show latest stable - Class: Float
round(p1 = v1)
public

Rounds flt to a given precision in decimal digits (default 0 digits). Precision may be negative. Returns a a floating point number when ndigits is more than one.

1.5.round      #=> 2
(-1.5).round   #=> -2