Hi,
I've been working with igGrid updating recently. I have a grid in which one column is editable and it's numeric. Default decimal seperator is a dot (.) but I want it to be a comma (,)
I have run into this thread in the forum and I tried the option for api but it did not work. Is there any other way to do so?
Thanks in advance and best regards
Hello,
In order to change the decimal separator in igNumericEditor decimalSeparator option should be used. This option could be set via the column settings of the Updating feature. For example:
features: [ { name: "Updating", columnSettings: [ { columnKey : "Number", editorType: "numeric", editorOptions: { decimalSeparator : "," } } ] } ]
Please test my suggestion on your side and let mw know whether it helps you achieve your requirement.
Do not hesitate to contact me if you have any additional questions regarding this matter.
Yes, thanks for the answer. That was the first thing I tried:
{ columnKey: "Value", editorType: "numeric", editorOptions: { textAlign: "left", nullValue: 1, revertIfNotValid: true, spinWrapAround: true, decimalSeperator: ',', groupSeperator: ' ' }, required: true }
It still uses dot (.) for decimal seperator. Which file contains this setting? Can I change it from there (manually)?
Setting the numeric decimal separator for igGrid could be achieved via the locale settings in particular via numercDecimalSeparator option. If this option is set the new separator is going to be applied to all igGrid columns that have decimal separators. For example:
$.ig.regional.defaults.numericDecimalSeparator = ",";
This option should be set before igGrid is created in order to take effect. Additionally, decimalSeparator option of the editor should be set (as explained in my previous post) as well in order to ensure that in edit mode the decimal separator is going to be ",".
I am attaching a small sample illustrating my suggestion for your reference. Please have a look at this demo and let me know if you have any additional questions regarding this matter.