1>>> x = 13.949999999999999999
2>>> x
313.95
4>>> g = float("{0:.2f}".format(x))
5>>> g
613.95
7>>> x == g
8True
9>>> h = round(x, 2)
10>>> h
1113.95
12>>> x == h
13True
1#to round floats in Python you can use the "round" function. ex:
2
3tax = 34.4563
4tax = round(tax, 2)
5
6#the number 2 at the end is how many digits are rounded.
7
8#the variable "tax" would now be: 34.46
1floatNumber = 2.13400
2#Method 1: use f-strings
3print(f"{floatNumber:.5f}") #Output: 2.13400
4#Method 2: use round
5print(round(floatNumber,5)) #Output: 2.134