Skip to content
Snippets Groups Projects
Commit 84d3bb37 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #1428 from metabase/non-lexical-numeric-field-value-sort

Don't sort numeric field values lexically
parents 4f5588be 2b24189c
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,8 @@ function equivalentArgument(field, table) {
if (isCategory(field)) {
if (field.id in table.field_values && table.field_values[field.id].length > 0) {
let validValues = table.field_values[field.id];
validValues.sort();
// this sort function works for both numbers and strings:
validValues.sort((a, b) => a === b ? 0 : (a < b ? -1 : 1));
return {
type: "select",
values: validValues
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment