Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/text/currency: numbers not being formatted based on the language #47623

Closed
alexedwards opened this issue Aug 10, 2021 · 2 comments
Closed

x/text/currency: numbers not being formatted based on the language #47623

alexedwards opened this issue Aug 10, 2021 · 2 comments
Labels
Milestone

Comments

@alexedwards
Copy link

@alexedwards alexedwards commented Aug 10, 2021

What version of Go are you using (go version)?

go1.16.5 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

package main

import (
	"golang.org/x/text/currency"
	"golang.org/x/text/language"
	"golang.org/x/text/message"
)

func main() {
	p := message.NewPrinter(language.German)
	p.Print(currency.EUR.Amount(123.56))
}

https://play.golang.org/p/EWlRXaoptzU

What did you expect to see?

EUR 123,56

With the German language decimal separator ,.

What did you see instead?

EUR 123.56

Note: Not using the currency package, but formatting the number manually yields the expected result - https://play.golang.org/p/W6SALPNJBg6

@gopherbot gopherbot added this to the Unreleased milestone Aug 10, 2021
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Aug 10, 2021

CC @mpvl via owners.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 5, 2021

Change https://golang.org/cl/353935 mentions this issue: text/currency: format currency amount according to the locale

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants