Hello,
I would like to output floating point numbers that include the thousands separators. In the US they would be commas",". For example, using %f with 12345.67 should yield "12,345.67". Is this possible without manually separating the number into strings? For example, can we set a locale that would specify the separators? Can we use printf to format the string correctly?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I would like to output floating point numbers that include the thousands separators. In the US they would be commas",". For example, using %f with 12345.67 should yield "12,345.67". Is this possible without manually separating the number into strings? For example, can we set a locale that would specify the separators? Can we use printf to format the string correctly?
Thanks!
Hello @saullipton,
internally printf is used for most of the formatting.
I did not find any flag to print out the number in the US style.
Best regards,
Marcel
Last edit: m.prestel 2021-01-22