real round code for python3

This commit is contained in:
Bigsk 2023-02-26 01:00:29 +08:00
parent cfd9d8db14
commit 536a648013

3
half_adjust.py Normal file
View 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