Mar-09-2018, 07:20 PM
It would be fantastic if there could be an easier way to round down to a specific decimal point using math.floor(). Then users wouldn't have to code a way around like this example below:
# Method to round numbers down, n being the number and d being the number of places after the decimal
def roundDown(n, d=8):
if d > 0:
d = int('1' + ('0' * d))
return floor(n * d) / d
elif d == 0:
d = int('1' + ('0' * d))
return round(floor(n * d) / d)
