我正在尝试在数字字段中使用千位分隔符保存数字
1000 >> 1,000
100000 >> 10,000
2000.02 >> 2,000.02
我想使用 js 和 jquery 来解决这个问题,我希望在用户输入时可以看到数千个分隔符。
<div class="form-group">
<label class="control-label col-md-2" Sum</label>
<div class="col-md-10">
@Html.EditorFor(model => model.Sum, new { htmlAttributes = new { @class = "form-control", @type = "number" } })
@Html.ValidationMessageFor(model => model.Sum, "", new { @class = "text-danger" })
</div>
</div>
有什么帮助吗?