1
0
Fork 0
mirror of https://github.com/neocities/neocities.git synced 2025-05-09 08:18:31 +02:00
neocities/ext/numeric.rb
2014-05-02 17:44:31 -07:00

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