/** * 数值保留指定位数小数 */ export default function toFixed(value, bit) { if (!value) { return 0; } const num = Math.pow(10, bit); return Math.round(value * num) / num; }