mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +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
|
||||
|
||||
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
|
Loading…
Add table
Reference in a new issue