Created
January 10, 2022 15:09
-
-
Save ldmarz/a74e8c2d8f419bb91ec6cf43a6c9e487 to your computer and use it in GitHub Desktop.
Fomatting numbers with golang.org/x/text/
This file contains 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