Created
May 5, 2023 13:10
-
-
Save misterunix/be9059d6475886520915c643e5965649 to your computer and use it in GitHub Desktop.
Pretty print, add 1000s separator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"golang.org/x/text/language" | |
"golang.org/x/text/message" | |
) | |
func main() { | |
p := message.NewPrinter(language.English) | |
p.Printf("%d\n", 1000) | |
// Output: | |
// 1,000 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment