Skip to content

Improve distance sorting in store locator#21

Open
Mark-H wants to merge 1 commit into
jdaehne:masterfrom
Mark-H:patch-1
Open

Improve distance sorting in store locator#21
Mark-H wants to merge 1 commit into
jdaehne:masterfrom
Mark-H:patch-1

Conversation

@Mark-H

@Mark-H Mark-H commented May 18, 2026

Copy link
Copy Markdown

Currently, the distance sort is comparing by strings.

17,123km distance appears before 2,123 distance because 1 comes before 2 in a string sort. (This might be locale dependent where it might work correctly currently if a period is used as decimal separator).

This patch corrects that, using an explicit float sort with the spaceship operator to ensure distances make sense.

Currently, the distance sort is comparing by strings. 

17,123km distance appears before 2,123 distance because 1 comes before 2 in a string sort. (This might be locale dependent where it might work correctly currently if a period is used as decimal separator). 

This patch corrects that, using an explicit float sort with the spaceship operator to ensure distances make sense.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant