3.2.0

Numeric sorting with comma as decimal separator

I do not seem to be able to sort properly a column with numeric content where the decimal separator is a comma.
Any idea ?

Example current sort :

544,222
8296,42
830,748

Should be :

544,222
830,748
8296,42
Erwin
May 27,
You should make a custom format object which will convert the text to the proper numeric values. The default implementation -

obj.textToValue = function(v){
return Number(("" + v).replace(numPattern, ""));
};

var numPattern = /[^0-9.\-+]+/gm;

- fails when decimal separator is a comma.
Alex (ActiveWidgets)
May 27,

This topic is archived.

See also:


Back to support forum