New to Kendo UI for Angular? Start a free 30-day trial

Restrictions

You can use the configuration options of the NumericTextBox to control the user input.

The NumericTextBox allows you to:

Fraction Length

The NumericTextBox allows you to specify the number of digits after the decimal separator which can be entered by the user by setting the decimals property. By default, the user input is not restricted.

Example
View Source
Edit In Stackblitz  
Change Theme:

Value Ranges

You can control the value ranges by providing values for the min, max, and autoCorrect properties of the NumericTextBox. When min, max, and autoCorrect are set, the component cannot hold a value that is greater than max and smaller than min.

Example
View Source
Edit In Stackblitz  
Change Theme:

Maximum Input Length

You can specify the maximum number of characters the user can type or paste in the NumericTextBox by setting the maxlength property. By default, the user input is not restricted.

The maxlength option does not restrict:

  • The length of the formatted value when the component is not focused.
  • Setting the component value programmatically through the value option or form control binding.
  • Changing the value through the spinners, the mouse wheel, or the keyboard navigation.

The locale-specific decimal separator and the negative sign (-) are included in the total allowed characters count.

The following example demonstrates how to restrict the user input by setting the maxlength option.

Example
View Source
Edit In Stackblitz  
Change Theme: