Author: eran_roz
Description:
Recently a new option of sortable tables was added, but the sorting script
doesn't sort properly numbers with commas (like 12,000). an example:
{| class="sortable"
numbers |
- |
12 |
- |
8 |
- |
9 |
- |
8.000 |
} |
and the results (from bigger to smaller number): "12", "9", "8", "8,000", and of
course it should be: "8,000", "12", "9", "8".
It should be noticed that the script works fine with dots (like 8.532). I'm
almost sure that the reason for this bug is wrong recognizing of numbers with
commas as strings, and not as numbers.
Maybe it can be fixed in sorttable.js by changing the line:
"if (itm.match(/^\s*[\d\.]+\s*$/)) sortfn = ts_sort_numeric;"
to
"if (itm.match(/^\s*[\d\.\,]+\s*$/)) sortfn = ts_sort_numeric;"
Version: unspecified
Severity: normal