Skip to content

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

Open
@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

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

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions