gpt4 book ai didi

javascript - kendo-ui 数字文本框不工作步长值 0.001

转载 作者:行者123 更新时间:2023-11-30 05:45:09 25 4
gpt4 key购买 nike

我在使用 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>

最佳答案

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

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

关于javascript - kendo-ui 数字文本框不工作步长值 0.001,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18351486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com