lib/humanize/giga.rb in humanize-bytes-2.0.0 vs lib/humanize/giga.rb in humanize-bytes-2.0.1

- old
+ new

@@ -23,10 +23,11 @@ def to_g self end def to_s(options = {}) - size = options.fetch(:decimal_digits, value.to_s.size) - ("%.#{size}f" % value).to_f + size = options.fetch(:decimal_digits, nil) + size ||= value.to_s.split('.').size == 1 ? 0 : value.to_s.split('.').last.size + ("%.#{size}f" % value).to_s end end end \ No newline at end of file