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

Problem with ItemLabel Formatting

1 Answer 32 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Bolik
Top achievements
Rank 1
Bolik asked on 25 May 2012, 11:24 AM
Hi.

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!

1 Answer, 1 is accepted

Sort by
0
Rosko
Telerik team
answered on 30 May 2012, 08:33 AM
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.

Regards,
Rosko
the Telerik team

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

Tags
Chart
Asked by
Bolik
Top achievements
Rank 1
Answers by
Rosko
Telerik team
Share this question
or