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
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@alexedwards
Copy link

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

CC @mpvl via owners.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 10, 2021
AlexanderYastrebov added a commit to AlexanderYastrebov/text that referenced this issue Oct 5, 2021
@gopherbot
Copy link

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

AlexanderYastrebov added a commit to AlexanderYastrebov/text that referenced this issue Oct 18, 2021
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 9, 2021
xhit pushed a commit to xhit/text that referenced this issue Oct 10, 2022
Fixes golang/go#47623

Change-Id: Ie6be9db93bf58f597f1ea4d864fcb507235b1018
GitHub-Last-Rev: 4c8f355
GitHub-Pull-Request: golang#27
Reviewed-on: https://go-review.googlesource.com/c/text/+/353935
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Trust: Marcel van Lohuizen <mpvl@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants