In Python floor()
and ceil()
round to the next higher or lower integer.
How to round up any value between 1.01 - 1.5 to 1.5 and 1.51 - 2.0 to 2.0 etc.?
Multiply by two, ceil()
, divide by two:
0.5 * ceil(2.0 * x)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With