real round code for python3
This commit is contained in:
parent
cfd9d8db14
commit
536a648013
3
half_adjust.py
Normal file
3
half_adjust.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
half_adjust = lambda n, u=0 : int(n * 10 ** u) / 10 ** u \
|
||||||
|
if n * 10 ** u - int(n * 10 ** u) < 0.5 \
|
||||||
|
else (int(n * 10 ** u) + 1) / 10 ** u
|
Loading…
Reference in New Issue
Block a user