python 123 + 0.00 code example Example: python 123 + 0.00 In [25]: n = 0.12345 In [26]: '{:.3f}'.format(n).lstrip('0') Out[26]: '.123'