JavaScript 字符串转数字

parseFloat("22.34.5"); //returns 22.34

Math.floor(),不四舍五入 ,向下取整
Math.floor(2.98)
2

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/11100348.html