After editing a number value on a German system, the value displayed is 100 times what it should be in the column, but the value displayed in the editor is correct.
I have tracked this down to the following code in ig.formatter:
// keep only e, E, -, +, . and digits
val = parseFloat(val.replace('(', '-').replace(/[^0-9\-eE\.\+]/gm, ''));
Since german uses , as the decimal separator and . as the thousands separator, applying the above code to a value such as 123,45 yields a value of 12345 while a value such as 1.234,56 yields a value of 1.23456.
Hi, Karl.
Thank you for using our product and I will be glad if I can help you.
You are right that the default settings of the Currency Editor are "." for decimal separator and "," for group separator. The editor can be configured in the following manner:
$('#currencyEditor').igCurrencyEditor({
decimalSeparator: ",",
groupSeparator: "."
});
In this way you can define the separators in opposite manner - "," for decimal separator and "." for group separator. Can tell me if this works for you? I will wait for your feedback and if you have any further questions don't hesitate to ask me.
Best regards, Nikolay Alipiev
Sorry, you misunderstood the problem: the correct infragistics regional settings are being automatically picked up, so the separators are configured correctly. The problem is the parsing code that I illustrated incorrectly assumes that the period should be retained. This is incorrect.
The correct version of this code is as follows:
// Karl - Moved from below prefix = cur ? curS : (perc ? percS : 'numeric'); if (!n) { // Karl - added next 4 to replace the decimal separator with . since parseFloat is not internationalized. s = reg[prefix + 'DecimalSeparator']; if (s && (s != '.')) { val = val.replace(s, '.'); } // keep only e, E, -, +, decimal separator and digits val = parseFloat(val.replace('(', '-').replace(/[^0-9\-eE\.\+]/gm, '')); } if (isNaN(val)) { return ' '; } // Karl - Moved this up //prefix = cur ? curS : (perc ? percS : 'numeric');