浏览代码

检查正整数

skyblued 2 年之前
父节点
当前提交
056f127d3f
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/helpers/toolsValidate.ts

+ 10 - 0
src/helpers/toolsValidate.ts

@@ -75,6 +75,16 @@ export function verifiyNumberInteger(val: string) {
 }
 
 /**
+ * 检测正整数
+ * @param val 当前值字符串
+ * @returns 返回boolean
+ */
+export function checkNumberInteger(val: string) {
+  var rep = /[\.]/
+  return !!rep.test(val)
+}
+
+/**
  * 去掉中文及空格
  * @param val 当前值字符串
  * @returns 返回处理后的字符串