Search code examples
stringgoformattingprintf

How to fmt.Printf an integer with thousands comma


Does Go's fmt.Printf support outputting a number with the thousands comma?

fmt.Printf("%d", 1000) outputs 1000, what format can I specify to output 1,000 instead?

The docs don't seem to mention commas, and I couldn't immediately see anything in the source.


Solution

  • None of the fmt print verbs support thousands separators.