【JS】【4】字符串数字比较大小

两个转换函数:

parseInt():把值转换成整数

parseFloat():把值转换成浮点数

也有其他方法,详情请看参考博客,但个人认为转换函数是最好的方法

参考博客:

1,js、jquery字符串数字比较大小_chorbin_新浪博客

http://blog.sina.com.cn/s/blog_4b7b2fc501010xar.html

猜你喜欢

转载自www.cnblogs.com/huashengweilong/p/10408227.html