Does Go\'s fmt.Printf
support outputting a number with the thousands comma?
fmt.Printf(\"%d\", 1000)
outputs 1000
, what format
You can also use this small package: https://github.com/floscodes/golang-thousands.
Just convert your number to a string an then use the Separate
-function like this:
n:="3478686" // your number as a string
thousands.Separate(n, "en") // adds thousands separators. the second argument sets the language mode.