python format string thousand separator with spaces

Here is bad but simple solution if you don’t want to mess with locale:

'{:,}'.format(1234567890.001).replace(',', ' ')

Leave a Comment