...
round(0.5) == 0, round(1.5) == 2, round(2.5) == 2
Code Block language py # Hack for intuitive rounding (0.5 -> 1) def rounder(number, ndigits=None): return round(number + 1e-8, ndigits)
...
...
round(0.5) == 0, round(1.5) == 2, round(2.5) == 2
Code Block | ||
---|---|---|
| ||
# Hack for intuitive rounding (0.5 -> 1)
def rounder(number, ndigits=None):
return round(number + 1e-8, ndigits) |
...