Merge pull request #221 from wvengen/feature-fix_float_display

Fix float display
This commit is contained in:
wvengen 2014-01-13 03:21:17 -08:00
commit 8f0e3af2ba

View file

@ -0,0 +1,17 @@
# we'd like to show "0.0" as "0"
class Float
alias :foodsoft_to_s :to_s
def to_s
foodsoft_to_s.chomp(".0")
end
end
if defined? BigDecimal
class BigDecimal
alias :foodsoft_to_s :to_s
def to_s(format = DEFAULT_STRING_FORMAT)
foodsoft_to_s(format).chomp(".0")
end
end
end