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

Round down when input is not in focus

1 Answer 145 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
The Cowboy
Top achievements
Rank 1
The Cowboy asked on 10 Jul 2020, 01:24 PM

The not in focus default for NumericTextBox always rounds to the nearest number defined by the format. 

For Example:

            $("#round_numeric").kendoNumericTextBox({
              format: "n0",
              value: 99.5,
              min: 0, max: 100,
            });

Displays 100.

I would like the not in focus format to round down (floor) so that the output is 99. 

Can this be achieved?

Thanks

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 14 Jul 2020, 08:03 AM

Hello Jeff,

Rounding a number down to its nearest integer is not supported for the NumericTextBox. 

I could suggest annually round down the value of the widget with the JS floor() method in the change event handler. However, this will update the value and not round it down when the input is blurred out. This approach can be examined in the following Dojo:

Regards,
Nikolay
Progress Telerik

Tags
NumericTextBox
Asked by
The Cowboy
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or