Commit 8df29435feea52474e1246707d84b68b9f82c2e2
1 parent
be0769d4
changed regular expression to fit exactly one zero
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/components/input-number/input-number.vue
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 | const iconPrefixCls = 'ivu-icon'; |
| 35 | 35 | |
| 36 | 36 | function isValueNumber (value) { |
| 37 | - return (/(^-?[0-9]+\.{1}\d+$)|(^-?[1-9][0-9]*$)/).test(value + ''); | |
| 37 | + return (/(^-?[0-9]+\.{1}\d+$)|(^-?[1-9][0-9]*$)|(^-?0{1}$)/).test(value + ''); | |
| 38 | 38 | } |
| 39 | 39 | function addNum (num1, num2) { |
| 40 | 40 | let sq1, sq2, m; | ... | ... |