mirror of
https://github.com/neocities/neocities.git
synced 2025-04-28 11:12:30 +02:00
clean up space representation a bit
This commit is contained in:
parent
584c7cfbd6
commit
7e36dc83f8
1 changed files with 3 additions and 1 deletions
|
@ -10,6 +10,8 @@ class Numeric
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_space_pretty
|
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
|
||||||
end
|
end
|
Loading…
Add table
Reference in a new issue