摘要: 用JS jquery取float型小数点后两位1. 最笨的办法……. [我就怎么干的.........]function get(){ var s = 22.127456 + “”; var str = s.substring(0,s.indexOf(“.”) + 3); alert(str);} 2. 正则表达式效果不错<scrīpt type=”text/javascrīpt”> onload = function(){ var a = “23.456322″; var aNew; var re = /([0-9]+\.[0-9]{2})[0-9]*/; aNew = a.re 阅读全文
posted @ 2012-07-10 15:31 愤怒的小鹏 阅读(31422) 评论(0) 推荐(0) 编辑