(TIL) Python: Thousands Separator in Formatted Strings

less than 1 minute read

It’s very easy to add thousands separators to numbers:

>>> big_num = 1234567890.123

>>> print(f'{big_num:,}')
1,234,567,890.123

Comments