Actually in Python 3 .85
will be round to .8
. As per the question .85
should be round to .9
.
Can you try the following:
round2 = lambda x, y=None: round(x+1e-15, y)
ts_folder = r'\{}'.format(str(round2(value, 1)))
Output:
>>> round2(.85, 1)
0.9
>>> round2(-.85, 1)
-0.8
manpreet
Best Answer
2 years ago
Is there any shorter, more legible code style to solve this problem? I am trying to classify some float values into interregional folders.