class Float
Public Instance Methods
round_up_with_precision(precision = nil)
click to toggle source
# File lib/Afip/core_ext/float.rb, line 5 def round_up_with_precision(precision = nil) precision.nil? ? round : ((self * (10 ** precision)).round + 1) / (10 ** precision).to_f end
round_with_precision(precision = nil)
click to toggle source
# File lib/Afip/core_ext/float.rb, line 2 def round_with_precision(precision = nil) precision.nil? ? round : (self * (10 ** precision)).round / (10 ** precision).to_f end