【发布时间】:2021-05-30 04:35:17
【问题描述】:
我怎样才能限制只接受两位小数,或者我怎样才能格式化只有两位小数。我尝试使用模型 RegularExpression(@"^\d+.\d{0,2}$" 并尝试了@step 01 和 tabindex 7,仍然无法正常工作,我们可以为十进制提供两个以上的数字。这是代码
@Html.TextBoxFor(m => m.attendanceLogList[i].NormalHrs, new
{
@class = "form-control input-sm emphrs",
@style = columnstyle,
@Value = Model.attendanceLogList[i].NormalHrs,
@type = "number",
@step = ".01",
onchange = "CalculateTotal(this);"
})
【问题讨论】:
标签: html asp.net-mvc