lib/quantify/quantity.rb
# Round the value attribute to the specified number of decimal places. If no
# argument is given, the value is rounded to NO decimal places, i.e. to an
# integer
#
Round the value attribute to the specified number of decimal places. If no
argument is given, the value is rounded to NO decimal places, i.e. to an
integer
Round the value attribute to the specified number of decimal places . If no argument is given the value is rounded to NO decimal places i . e . to an integer
def round!(decimal_places=0)
      factor = ( decimal_places == 0 ? 1 : 10.0 ** decimal_places )
      @value = (@value * factor).round / factor
      return self
    end
def round! ( decimal_places = 0 ) factor = ( decimal_places == 0 ? 1 : 10.0 ** decimal_places ) @value = ( @value * factor ) . round / factor return self end
Round the value attribute to the specified number of decimal places.
Round the value attribute to the specified number of decimal places .
decimal_places
<not_specific>