如何找到一个数字是float或integer?
1.25 --> float
1 --> integer
0 --> integer
0.25 --> float
Run Code Online (Sandbox Code Playgroud) 我传入一个名为value的参数.我想知道价值是否是浮动.到目前为止,我有以下内容:
if (!isNaN(value))
{
alert('this is a numeric value but not sure if it is a float.');
}
Run Code Online (Sandbox Code Playgroud)
如何更进一步将字符串转换为可以计算为浮点数的字符串?