mirror of https://github.com/layui/layui
修复 form 在 IE 和 Safari 存在一个正则零宽断言报错的问题
parent
e3dcb915a1
commit
0f9ca9c6f5
|
@ -296,7 +296,8 @@ layui.define(['lay', 'layer', 'util'], function(exports){
|
|||
|
||||
// 小数点后保留位数
|
||||
var fixed = function(step){
|
||||
return (step.match(/(?<=\.)[\d]+$/) || [''])[0].length;
|
||||
var decimals = (step.match(/\.(\d+$)/) || [])[1] || '';
|
||||
return decimals.length;
|
||||
}(step.toString());
|
||||
if(fixed) value = value.toFixed(fixed);
|
||||
|
||||
|
|
Loading…
Reference in New Issue