Hi Team
I am looking for very urgent quick help
i have columns applied currency format, is there any way to have one column with two decimal which is default but another column with three decimal and another with four decimal.
I understand that $.ig.regional.defaults i have to set min/max value for currency, suppose i set min to 0 and max to 9 and but how can we set dynamically column decimal value to according to my need for each column.
How can I achieve that.
I felt $.ig.formatter this can help me but didn't understand this function completely, since its not mentioned any documentation can you help me to understand this function.
I tried this but didn't worked $.ig.formatter(9332.44567889, "number", "currency",null,null,'0.00')
Your ASAP response will be very helpful for me.
Thanks
Hello ptilwani,
I am glad that you find this suggestion helpful.
This suggested change in regional settings could have effect if you are using the regional settings anywhere else in your application. For example, if you have another igGrid used in your application it will use the modified regional settings.
If you would like to keep the default settings for other aspects of the application you could reset the default value of the decimals back to 2(which is the default value) after you are done.
Please let me know if you need any further assistance with this matter.
Hi Maya
one small question as you said we have to change default setting and and use formatter. since we are changing default settings is this will effect any where else too?
Thanks Maya
so appreciated, that's i was looking for i have thought but how to implement that's your suggestion shows me a light and bring me on right direction.
Thank you so much....
i will try your solution and if any doubt i will post you.. but looks it will work for me...
Thank you!!!
You could also use the $.ig.formatter function if you don’t want to lose the other default regional formatting settings. However in that case you would need to modify the currencyMaxDecimals and currencyMinDecimals options since the formatter function uses them to specify the number of decimals to show.
Here’s an example:
{ headerText: "Price1", key: "Price1", dataType: "number", formatter: function (val, data) {
$.ig.regional.defaults.currencyMaxDecimals = 2;
$.ig.regional.defaults.currencyMinDecimals = 2;
return $.ig.formatter(val, "number", "currency");
}
},
{ headerText: "Price2", key: "Price2", dataType: "number", formatter: function (val, data) {
$.ig.regional.defaults.currencyMaxDecimals = 3;
$.ig.regional.defaults.currencyMinDecimals = 3;
} ,
{ headerText: "Price3", key: "Price3", dataType: "number", formatter: function (val, data) {
$.ig.regional.defaults.currencyMaxDecimals = 4;
$.ig.regional.defaults.currencyMinDecimals = 4;
With the above settings the “Price1” column will show a currency value with 2 decimals. “Price2” will show a currency value with 3 decimals and so on.
I’ve attached a modified sample for your reference. Let me know if you have any questions.
Best Regards,
Maya Kirova
Product Developer
Infragistics, Inc.
https://ko.infragistics.com/support
Hello Vasya
I tried your solutions and its worked great in decimal places, thanks for your help but in this solution i am loosing currency group separator as well as negative currency format. i did some googling and come with this solution(attached).
but i am curious is there any great (infragistic) way to do that.
Thanks and Regards