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

how to round up

2 Answers 378 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
kako
Top achievements
Rank 1
kako asked on 19 Feb 2018, 08:36 AM

Is there how to round up the value ?

 ex) 16.543 → 16.55

I can only set rounding or truncation for the "round" option...

2 Answers, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 20 Feb 2018, 11:50 AM
Hi Kako,

By default a value is rounded up if the next digit is bigger than or equal to 5. For example 1.245 will be rounded to 1.25 and 1.243 will be rounded to 1.24. In order to change that behavior you would need to use custom logic. I can suggest handling the change event and round the entered value manually.

The dojo example below illustrates the approach:


Give it a try and let me know how it works for you.

Regards,
Viktor Tachev
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.
0
kako
Top achievements
Rank 1
answered on 05 Mar 2018, 07:15 AM
It worked as expected. Thanks!
Tags
NumericTextBox
Asked by
kako
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
kako
Top achievements
Rank 1
Share this question
or