公告板
版本库
filestore
活动
搜索
登录
main
/
lithium-battery-web
锂电池监测维护一体化平台
概况
操作记录
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
U 测试过程中修改
he wei
2024-11-01
6fe5223e3ba751e7795d26f4d4f1cc2cfd648715
[lithium-battery-web.git]
/
src
/
assets
/
js
/
tools
/
toFixed.js
1
2
3
4
5
6
7
8
9
10
/**
* 数值保留指定位数小数
*/
export default function toFixed(value, bit) {
if (!value) {
return 0;
}
const num = Math.pow(10, bit);
return Math.round(value * num) / num;
}