I want to display:
49 as 49.00
49
49.00
and:
54.9 as 54.90
54.9
54.90
Regardless of the length of the decimal
>>> print "{:.2f}".format(1.123456) 1.12
You can change 2 in 2f to any number of decimal points you want to show.
2
2f
From Python3.6, this translates to:
Python3.6
>>> print(f"{1.1234:.2f}") 1.12