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

Remove trailing zeros

3 Answers 87 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
shirley wang
Top achievements
Rank 1
shirley wang asked on 27 Oct 2010, 06:01 PM
Dear People,

I'm looking for a way to remove trailing zero's from numeric fields.

e.g.

1.00 should display as 1

1.50 should display as 1.5

0.50 should display as 0.5

Any idea?


Best wishes

Shirley Wang

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 28 Oct 2010, 09:29 AM
Hello Shirley,

Thank you for contacting us.

To achieve your goal you can use the NumberDecimalDigits property of the NumericUpDown control.

If you have any other questions please let us know.

Sincerely yours,

Konstantina
the Telerik team

 

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
shirley wang
Top achievements
Rank 1
answered on 28 Oct 2010, 06:11 PM
Hello Konstanti,

Thank you for your answer. But it is not what i want.

I have set NumberDecimalDigits. The problem is, here is an example.

I have a person A weight 70.3 kg.

If i set NumberDecimalDigits = 2, i have 70,30 kg be showed (with trailing zero).
If i set NumberDecimalDigits = 1, i have 70,3 kg be showed (beautiful). But
the user has no opportunity to change the weight to 70,35 kg.

Best wishes

Shirley
0
Konstantina
Telerik team
answered on 01 Nov 2010, 12:55 PM
Hello Shirley,

Unfortunately, there is no such feature supported by the RadNumericUpDown control. You can implement it using the LostFocus event and change the Text of the TextBox.

Please feel free to contact us again if you have any other questions.

Best wishes,
Konstantina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
NumericUpDown
Asked by
shirley wang
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
shirley wang
Top achievements
Rank 1
Share this question
or