How can I format an integer column without comma separator?
Hi drchip,
I am pleased to see that you found a solution. Let us know if you need any additional assistance!
Thanks!
I found a solution. Just remove dataType and format.
{ headerText: 'Id', key: 'ID', width:'50px' }
Formatter approach does not work either. The val variable is a number type so there is no comma to strip even if you toString the value.
http://sdrv.ms/12zjR8i
Hi Dean,
Yes, I see the issue...
What you can do use use a column 'formatter' and strip-out the "," comma seperator.
For example, you can try the following:
function formatNumber (val) { if (typeof val !== "number" || isNaN(val)) { return "Not set"; } return "$" + val.toString().replace(/\,/g,'');
}
.....and then set the formatter in your column settings:
columns: [ { headerText: "Number", key: "Number", formatter: formatNumber} ]
This should do the trick to strip out the comma from the integer column. Let me know if you need any additional assistance.
Hi Troy,
Your suggested solution does not works. Here is the link to the image to show the result. http://sdrv.ms/18nfL7E
Thanks,
Dean