Number formats

4 posts, 0 answers
  1. T.
    T. avatar
    25 posts
    Member since:
    Aug 2012

    Posted 28 Aug 2012 Link to this post

    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!
  2. OnaBai
    OnaBai avatar
    55 posts
    Member since:
    Aug 2012

    Posted 07 Sep 2012 Link to this post

    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).
  3. Kendo UI is VS 2017 Ready
  4. T.
    T. avatar
    25 posts
    Member since:
    Aug 2012

    Posted 14 Sep 2012 Link to this post

    Hi OnaBai,

    thanks, that helped!
  5. Masaab
    Masaab avatar
    15 posts
    Member since:
    Nov 2013

    Posted 24 Mar 2014 Link to this post

    you can use something like this:

    columns:[
             {
                field: 'MyNumericalDigits',
                title: 'NDigits',
               format: '{0:0,00}'
             }
    ]
Back to Top
Kendo UI is VS 2017 Ready