mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-07 21:38:14 -08:00
21 lines
289 B
Ruby
21 lines
289 B
Ruby
# frozen_string_literal: true
|
|
|
|
module FloatMonkeyPatches
|
|
def round_up_to_one
|
|
if positive? && self < 1
|
|
1.0
|
|
else
|
|
self
|
|
end
|
|
end
|
|
|
|
def round_down_to_five
|
|
if positive? && self > 5
|
|
5.0
|
|
else
|
|
self
|
|
end
|
|
end
|
|
end
|
|
|
|
Float.include FloatMonkeyPatches
|