我如何将这样的指数小数四舍五入:
2.4451778232910804e-26.toFixed(4) => 2.4452e-26
。在文档中,使用.toFixed()
每次都会给我0
。是否有一个专门用于“指数小数”的函数? 我宁愿不修改Number.prototype.toFixed()
。