clean up space representation a bit

This commit is contained in:
Kyle Drake 2014-10-06 17:52:18 -07:00
parent 584c7cfbd6
commit 7e36dc83f8

View file

@ -10,6 +10,8 @@ class Numeric
end
def to_space_pretty
"#{(self.to_f / ONE_MEGABYTE).round(2).to_s} MB"
space = (self.to_f / ONE_MEGABYTE).round(2)
space = space.to_i if space.denominator == 1
"#{space} MB"
end
end