Flowdock
floor(*args) public

Returns the largest number less than or equal to float in decimal digits (default 0 digits).

Precision may be negative. Returns a floating point number when ndigits is positive, self for zero, and floor down for negative.

1.2.floor      #=> 1
2.0.floor      #=> 2
(-1.2).floor   #=> -2
(-2.0).floor   #=> -2

1.234567.floor(2)  #=> 1.23
1.234567.floor(3)  #=> 1.234
1.234567.floor(4)  #=> 1.2345
1.234567.floor(5)  #=> 1.23456

34567.89.floor(-5) #=> 0
34567.89.floor(-4) #=> 30000
34567.89.floor(-3) #=> 34000
34567.89.floor(-2) #=> 34500
34567.89.floor(-1) #=> 34560
34567.89.floor(0)  #=> 34567
34567.89.floor(1)  #=> 34567.8
34567.89.floor(2)  #=> 34567.89
34567.89.floor(3)  #=> 34567.89
Show source
Register or log in to add new notes.