Commit f87447f9 authored by Nathan's avatar Nathan 🚴

creating new talks repo

parent 5f3a0d7d
This diff is collapsed.
This diff is collapsed.
def custom_number_rounding(number):
""" Takes in a number and separates out the whole and the fraction, and
returns a custom rounded value.
...
"""
try:
assert type(number) in [int, float]
except AssertionError:
return False, 0
if number == 0:
return True, 0
else:
frac, whole = math.modf(number)
if frac >= 0.8:
number = int(whole) + 1
elif frac < 0.8:
number = int(whole)
return True, number
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment