Class: Float
- Inherits:
-
Object
- Object
- Float
- Defined in:
- lib/auto12epl.rb
Overview
Jeremy Espino MD MS 28-JAN-2016
Instance Method Summary collapse
-
#round_down(n = 0) ⇒ Object
function to round down a float to an integer value.
Instance Method Details
#round_down(n = 0) ⇒ Object
function to round down a float to an integer value
9 10 11 |
# File 'lib/auto12epl.rb', line 9 def round_down(n = 0) n < 1 ? to_i.to_f : (self - (0.5 / (10**n))).round(n) end |