lib/latinum/formatters.rb in latinum-0.5.6 vs lib/latinum/formatters.rb in latinum-0.6.0
- old
+ new
@@ -51,9 +51,13 @@
@zero = options[:zero] || '0'
@name = options[:name]
end
+ def round(amount)
+ return amount.round(@places)
+ end
+
def format(amount, options = DEFAULT_OPTIONS)
# Round to the desired number of places. Truncation used to be the default.
amount = amount.round(@places)
fix, frac = amount.abs.to_s('F').split(/\./, 2)