简体   繁体   中英

kendo-ui numeric textbox not working a step value of 0.001

I'm having some troubles with Kendo UI's numeric text box. Namely, it will not working with a step value of 0.001. In the example code below I have gotten 0.001 to work with HTML5 but it does not increment with Kendo. If I change it to 0.01 then it works fine. Does anyone know why or have any work arounds?

    <input type="number" id="inputN" value="1.010" step="0.001" style="width: 100px;" />

    <input id="inputNum" value="1.010" />

    <script type="text/javascript">
        $(document).ready(function () {
            $('#inputNum').kendoNumericTextBox({
                    format: '#.000',
                    step: 0.001
                });
        });
    </script>

You need to combine it with decimals option (specifies the number precision, if not set precision defined by current culture is used.)

$('#inputNum').kendoNumericTextBox({
    format  : '#.000',
    step    : 0.001,
    decimals: 3
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM