Skip to content

isNumeric ​

判断值是否为数字或数字字符串(支持小数)。

用法 ​

ts
import { isNumeric } from '@qingpai/utils'

isNumeric(42) // true
isNumeric('3.14') // true
isNumeric('abc') // false

参数 ​

名称类型描述
valuestring | number待判断的值

返回值 ​

value is string — 是否为数字或数字字符串。

轻排编辑器 — 教育领域富文本编辑器