2015年8月28日

Js 和 PHP 中保留小数点后X位数的方法 toFixed、round、number_format、sprintf

摘要: 在 Javacript 中保留小数点后两位数的方法为 toFixed(2),其中的2为保留两位,写多少就保留多少了,满5进1。Javacript例子: var num = 24.54789523; alert( num.toFixed(2) ); /... 阅读全文

posted @ 2015-08-28 04:39 今天又进步了 阅读(784) 评论(0) 推荐(0)

导航