Skip to content

x/text/collate: CompareString(collate.Numeric) returns wrong result for "0.0" vs "1.0" #67997

@wxiaoguang

Description

@wxiaoguang

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

Activity

added this to the Unreleased milestone on Jun 14, 2024
added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Jun 15, 2024
lordwelch

lordwelch commented on Nov 7, 2024

@lordwelch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wxiaoguang@lordwelch@gopherbot@seankhliao

        Issue actions

          x/text/collate: CompareString(collate.Numeric) returns wrong result for "0.0" vs "1.0" · Issue #67997 · golang/go