在我的asp.net MVC应用程序中,我使用Kendo grid来显示数据库表中的数据。下面的代码用于显示"Price“列,最多可显示六位小数。它在加载时显示" Price“值,但当我单击Price进行编辑时,它的值自动四舍五入到两个小数位。例如,如果它从数据库加载值456.345674,在编辑模式下,textbox会将值四舍五入为456.35,我不希望将值四舍五入为两位数。它应该保持小数位不变。请提个建议。
{
field: "Price",
type: "number",
filterable: {
cell: {
template: function (args) {
args.element.kendoNumericTextBox({
format: "#.######",
decimals:6
});
},
operator: "gte"
}
},
width: 140
}发布于 2016-05-10 20:18:33
KendoNumericTextBox不需要#.######格式。如果你想强制使用6位小数,正确的格式应该是n6。如果要显示整个数字而不进行舍入,则格式应为n。
您可以参考kendo's number formatting documentation查看可用的格式。
https://stackoverflow.com/questions/37137902
复制相似问题