Spreadsheet percentage format does unexpected things

2 posts, 1 answers
  1. Peter
    Peter avatar
    7 posts
    Member since:
    Feb 2017

    Posted 10 Oct Link to this post

    Hi!

    Please have a look at this demo: http://dojo.telerik.com/AWamE

    Last 2 columns should behave the same. Only difference between then is the format specifier, once is '%' second is 'prc'.

    But they are not. The '%' sees the column as percentage, so:

    1. Multiplies the value I give with 100

    2. When editing, % remains in place, even though in the second part it disappears. I would like to have it gone

     

    Any ideas on how to make the % fields behave just like other format specifiers?

    Thanks!

     

  2. Answer
    Joana
    Admin
    Joana avatar
    134 posts

    Posted 12 Oct Link to this post

    Hi Peter,

    The % is a special formatting symbol which indeed multiplied the number by 100 and insert percentage symbol in the cell. If you need to prevent this behavior, you should add double backslash before the % symbol in the formatting string: 

    {
         value: 12,
         format: '#,0.00 \\\%'
    }

    Here is the updated dojo: http://dojo.telerik.com/AWamE/2 and an article that contains more information about the number formatting:

    https://docs.telerik.com/kendo-ui/framework/globalization/numberformatting#custom

    Regards,
    Joana
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top