Problem with ItemLabel Formatting

2 posts, 0 answers
  1. Bolik
    Bolik avatar
    3 posts
    Member since:
    Jun 2012

    Posted 25 May 2012 Link to this post


    How can I display maximum two decimal numbers in the label?

    For example,
    value=1.1111, but I want to display 1.11.

    The format ItemLabelFormat="#Y{0.##}" doesn't work. 
    I don't want to use format ItemLabelFormat="#Y{0.00}" because it always displays two digits (for 1 it will display 1.00).

    Can anybody help me?

    Thank you!
  2. Rosko
    Rosko avatar
    137 posts

    Posted 30 May 2012 Link to this post

    Hi Bolik,

    If you do not set up the ItemLabelFormat property, the default one will round all decimals to the second digit after the dot. For example 1.1111 will be displayed as 1.11 and 1.119 will be rounded to 1.12. If you have a round number like 1, it will be displayed just 1 and not 1.00. You can see an attached screenshot of the result.

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top