mirror of
https://github.com/neocities/neocities.git
synced 2025-06-28 23:23:22 +02:00
start on accounts using site context, improved settings page, clean up space representation
This commit is contained in:
parent
8a36f1c6f5
commit
d3c1546d45
17 changed files with 243 additions and 105 deletions
|
@ -1,5 +1,15 @@
|
|||
class Numeric
|
||||
ONE_MEGABYTE = 1048576
|
||||
|
||||
def roundup(nearest=10)
|
||||
self % nearest == 0 ? self : self + nearest - (self % nearest)
|
||||
end
|
||||
end
|
||||
|
||||
def to_mb
|
||||
self/ONE_MEGABYTE.to_f
|
||||
end
|
||||
|
||||
def to_space_pretty
|
||||
"#{(self.to_f / ONE_MEGABYTE).round(2).to_s} MB"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue