All Components

Restrictions

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

The NumericTextBox allows you to:

Fraction Length

It is possible to specify the number of digits after the decimal separator that the user can enter, set the decimals property. By default, the user input is not restricted.

@Component({
    selector: 'my-app',
    template: `
        <kendo-numerictextbox
            [decimals]="decimals"
            [format]="format"
            [value]="value"
        ></kendo-numerictextbox>
    `
})

class AppComponent {
    public decimals: number = 3;
    public value: number = 5;
    public format: string = 'n3';
}

Value Ranges

It is possible to control the range of the value by providing values for the min, max, and autoCorrect properties. When min, max, and autoCorrect are set, the component cannot hold a value that is greater than max and smaller than min.

@Component({
    selector: 'my-app',
    template: `
        <p>Enter value between 1 and 5.</p>
        <kendo-numerictextbox
            [autoCorrect]="autoCorrect"
            [min]="min"
            [max]="max"
            [value]="value"
        ></kendo-numerictextbox>
    `
})

class AppComponent {
    public autoCorrect: boolean = true;
    public min: number = 1;
    public max: number = 5;
    public value: number = 2;
}
In this article