This is a migrated thread and some comments may be shown as answers.

Issue in number formatting in Kendo grid column

2 Answers 2930 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krishnan
Top achievements
Rank 1
Krishnan asked on 21 Dec 2016, 03:44 PM
I am trying to format the number with comma when the number of digits are more e.g. 10,240,000. I tried applying the following format in the Kendo grid column and it works fine when there is value available in the grid column, but when the grid cell value is returned as "0", then the format returns as "00". Instead the preferred text should be "0" when the actual value is "0", and any number more than 0 i.e. if the digits grows more than 4, then it should format with comma appropriately. Please refer snapshot
The following code is what I am trying to do the format,
  { field: "lastUpdatedSize", title: "Test", width: "10px", format: '{0:0,0}' },

How do I fix this issue?

2 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 21 Dec 2016, 04:28 PM

Hello Krishnan,

Try using format: "{0:n0}". 

Dan

0
Krishnan
Top achievements
Rank 1
answered on 21 Dec 2016, 04:33 PM
It works fine, thanks
Tags
Grid
Asked by
Krishnan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Krishnan
Top achievements
Rank 1
Share this question
or