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/message: scientific format is incorrect #71428

Open
jcking opened this issue Jan 24, 2025 · 4 comments
Open

x/text/message: scientific format is incorrect #71428

jcking opened this issue Jan 24, 2025 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jcking
Copy link

jcking commented Jan 24, 2025

Go version

N/A

Output of go env in your module/workspace:

N/A

What did you do?

Formatting a float for scientific results in extra spaces around the superscriptingExponent. ICU4C does not produce these same spaces when using unicode/scientificnumberformatter.h and CLDR does not suggest them either in current standards. See cel-go for the Go code.

What did you see happen?

1.052033 × 10⁰³

Note the extraneous NARROW NO-BREAK SPACE around the exponent separator.

What did you expect to see?

1.052033×10⁰³

Note the removal of the extraneous NARROW NO-BREAK SPACE around the exponent separator.

@seankhliao
Copy link
Member

can you show a self contained reproducer in Go code without using cel.

@seankhliao seankhliao changed the title golang.org/x/text: scientific format is incorrect x/text: scientific format is incorrect Jan 24, 2025
@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 24, 2025
@gopherbot gopherbot added this to the Unreleased milestone Jan 24, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/644121 mentions this issue: x/text: fix scientific notation by removing extraneous spaces

@jcking
Copy link
Author

jcking commented Jan 24, 2025

package main

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

func main() {
	message.NewPrinter(message.MatchLanguage("en")).Printf("%e", 1.1)
}

@jcking
Copy link
Author

jcking commented Jan 24, 2025

@seankhliao seankhliao removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 24, 2025
@seankhliao seankhliao changed the title x/text: scientific format is incorrect x/text/message: scientific format is incorrect Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants