js background takes float decimals and retains the specified number of digits

The toFixed() method rounds a Number to the specified number of decimal places.

例子:htmls+="<h3>"+parseFloat(it.detailvalue).toFixed(2)+"</h3>\n"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324902759&siteId=291194637