-7
print("Worth: " + GREEN2 + str(GemValue) + END)

How do I round GemValue to 2 decimals?

Sometimes I get values like 50.9999999999992

Chris
  • 26,361
  • 5
  • 21
  • 42

2 Answers2

0

This should do it for you

str(round(GemValue,2))
Pragmatic_Lee
  • 473
  • 1
  • 4
  • 10
0
print("{:.2f}".format(GemValue))

should do the trick