I have found two ways of taking floors in Python:
3.1415 // 1
and
import math
math.floor(3.1415)
The problem
from math import floor
def ff(num, step=0):
if not step:
return floor(num)
if step < 0:
mplr = 10 ** (step * -1)
return floor(num / mplr) * mplr
ncnt = step
if 1 > step > 0:
ndec, ncnt = .0101, 1
while ndec > step:
ndec *= .1
ncnt += 1
mplr = 10 ** ncnt
return round(floor(num * mplr) / mplr, ncnt)
You can use positive/negative numbers and float points .1, .01, .001...