Cell Format

4 posts, 1 answers
  1. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 10 Mar 2017 Link to this post

    I have a number 67.75, with the format mask "###,###,##0.00%". I would expect 67.75%, however I am getting 6775.00%

    I have the mask because I need comma's for thousand separator, and always 2 decimal places with the percentage sign.

    Why isn't this working?

  2. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 10 Mar 2017 in reply to Marc Link to this post

    I have changed my number to be a proper percentage, with the format mask "###,###,##0.00%"

    I understand this means always show 2 decimal places and 1 integer number.

    However percentages of 90.10% are being shown as 90.1%

  3. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 13 Mar 2017 Link to this post

    Hi Marc,

    The problem with the percentage happens because the percentage sign is a special formatting symbol, as explained here. To escape it, you can prefix it with a double backslash. With this change applied, your format string works as expected and 90.10 is shown as "90.10%" which, if I understand correctly, is the needed result:
    http://dojo.telerik.com/@tsveti/edoHo

    Regards,
    Tsvetina
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 13 Mar 2017 in reply to Tsvetina Link to this post

    Hi Tsvetina

    Thank you! I must have missed that part of the documentation. Cheers!

    Marc

Back to Top