var re = 505899.24- 495991.61- 9907.63;
var test1 = /\d(?:.(\d*))?e([+-]\d+)/.test(re);
alert("是否是科学计算结果:"+test1);
var test2 = re.toFixed(10)-0;
alert("处理后的结果:"+ test2 );
JS判断是否是科学计算结果并处理
最新推荐文章于 2023-05-30 10:08:42 发布
var re = 505899.24- 495991.61- 9907.63;
var test1 = /\d(?:.(\d*))?e([+-]\d+)/.test(re);
alert("是否是科学计算结果:"+test1);
var test2 = re.toFixed(10)-0;
alert("处理后的结果:"+ test2 );