mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
9 lines
No EOL
208 B
Ruby
9 lines
No EOL
208 B
Ruby
class Numeric
|
|
def roundup(nearest=10)
|
|
self % nearest == 0 ? self : self + nearest - (self % nearest)
|
|
end
|
|
|
|
def rounddown(nearest=10)
|
|
self % nearest == 0 ? self : self - (self % nearest)
|
|
end
|
|
end |