int.round([ndigits]) â integer or float
Instance Public methods
Rounds flt to a given precision in decimal digits (default 0
digits). Precision may be negative. Returns a floating point number when
ndigits is positive, self for zero, and round
down for negative.
1.round #=> 1
1.round(2) #=> 1.0
15.round(-1) #=> 20