0

Let's say X = 1.14 And I want to round X up to 1.20 and not 1.10 How do I do this?

I have tried...

print(round(x,2))

and the output is 1.10

big boss
  • 11
  • 4

1 Answers1

0

Try:

import math

x = 1.14
rounded_up = math.ceil(x * 10) / 10  # round up to one decimal place
print(rounded_up)
RMT
  • 105
  • 8