more copy fixes

This commit is contained in:
Kyle Drake 2014-04-23 15:07:00 -07:00
parent 46e05ccb54
commit 3b0dd09b97
6 changed files with 50 additions and 12 deletions

View file

@ -96,3 +96,13 @@ class Sinatra::Base
render_original engine, data, options, locals, &block
end
end
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