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

Number formats

3 Answers 987 Views
Globalization
This is a migrated thread and some comments may be shown as answers.
T.
Top achievements
Rank 1
T. asked on 28 Aug 2012, 08:45 AM
Hi,

I need help on number formats in e.g. Kendo grid.
My number is 123456,78 and I need a format like 123.456,780.
In different threads I read formats like "{0:c}", "{0:0.000}", etc..
But I don't understand the formatting.
What means the 0 before the colon, and what possibilities I have to format the numbers?

Thanks for any help!

3 Answers, 1 is accepted

Sort by
0
OnaBai
Top achievements
Rank 2
answered on 07 Sep 2012, 08:18 PM
Did you check Number Formatting documentation? I think it might help you.
The c is for currency and depends on the culture (your language and country).
The 0.000 is the format where 0 is space for a digit while "." might be decimals separator or the group separator.
I.e:
If your culture is en-EN and you are displaying 1.234, your number will be one unit and two hundred thirty four thousands of unit BUT if your culture is de-DE, you are representing one thousand two hundred and thirty four units and the number is displayer with 3 decimals.

The first 0 is, afaik, the argument number (always 0).
0
T.
Top achievements
Rank 1
answered on 14 Sep 2012, 07:03 AM
Hi OnaBai,

thanks, that helped!
0
Masaab
Top achievements
Rank 1
answered on 24 Mar 2014, 11:47 PM
you can use something like this:

columns:[
         {
            field: 'MyNumericalDigits',
            title: 'NDigits',
           format: '{0:0,00}'
         }
]
Tags
Globalization
Asked by
T.
Top achievements
Rank 1
Answers by
OnaBai
Top achievements
Rank 2
T.
Top achievements
Rank 1
Masaab
Top achievements
Rank 1
Share this question
or