2

我在使用 Kendo UI 的数字文本框时遇到了一些问题。即,它不适用于步长值为 0.001。在下面的示例代码中,我已经获得了 0.001 以使用 HTML5,但它不会随着 Kendo 增加。如果我将其更改为 0.01,那么它工作正常。有谁知道为什么或有任何解决方法?

    <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>
4

1 回答 1

1

您需要将其与decimals选项结合使用(指定数字精度,如果未设置则使用当前文化定义的精度。)

$('#inputNum').kendoNumericTextBox({
    format  : '#.000',
    step    : 0.001,
    decimals: 3
});
于 2013-08-21T08:15:49.093 回答