Stange rounding of numbers in Confirmation

You can read more about the issues with floating point numbers here: 15. Floating Point Arithmetic: Issues and Limitations — Python 3.11.4 documentation

Rather than trying to round numbers for display, use f strings and specify how many decimal points you want to display, e.g. f"{self.tb_new_target.text:.2f}", to convert the floating point number into a string that has the right number of decimal places.

3 Likes