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/collate: CompareString(collate.Numeric) returns wrong result for "0.0" vs "1.0" #67997

Open
wxiaoguang opened this issue Jun 14, 2024 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@wxiaoguang
Copy link

Go version

go version go1.22.1 darwin/arm64

Output of go env in your module/workspace:

N/A

What did you do?

	c := collate.New(language.English, collate.Numeric)
	r1 := c.CompareString("0", "1")
	r2 := c.CompareString("0.0", "1.0")
	println(r1, r2)

What did you see happen?

r1 == -1 and r2 == 1 (WRONG)

What did you expect to see?

r1 == -1 and r2 == -1

@gopherbot gopherbot added this to the Unreleased milestone Jun 14, 2024
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 15, 2024
@lordwelch
Copy link

My PR golang/text#50 should fix this as well

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

4 participants