Skip to content

Instantly share code, notes, and snippets.

@vidhill
Created February 24, 2022 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vidhill/7f0ad8ccde6c18005e172428d0d49866 to your computer and use it in GitHub Desktop.
Save vidhill/7f0ad8ccde6c18005e172428d0d49866 to your computer and use it in GitHub Desktop.
Go, print numbers with thousand separators
package main
import (
"golang.org/x/text/language"
"golang.org/x/text/message"
)
// create a new printer withe the locale set to english
var print = message.NewPrinter(language.English)
func main() {
print.Printf("Num of docs: %d\n", 100000000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment