autoNumeric JS doen不允许我输入小数

时间:2014-08-23 13:28:25

标签: c# javascript jquery asp.net

这里我使用autoNumeric JS。在我的代码中,它不允许我输入小数点

代码

 $('.input-qty').autoNumeric('init', { vMin: 0, mDec: 0 }); // It only allows 1,2 like numbers it doen't allow 1.5 like decimal points

1 个答案:

答案 0 :(得分:3)

来自:https://github.com/BobKnothe/autoNumeric

"vMin" - controls the minimum value allowed
vMin: '0.00' (default)

"mDec" - overrides the decimal places that that are set via the vMin/vMax values
mDec: null (default method)
example - mDec: '4'

所以你设置零小数位。将代码更改为允许小数:

 $('.input-qty').autoNumeric('init', { vMin: 0, mDec: 2 });