|
|
@@ -532,9 +532,9 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
numberSplit(num) {
|
|
|
- const targetLength = 5; // 目标数组长度
|
|
|
- const digits = Array.from(String(num), Number); // [1, 2, 3]
|
|
|
- const zerosToAdd = targetLength - digits.length; // 需要补的 0 的数量
|
|
|
+ const targetLength = 6; // 目标数组长度
|
|
|
+ const digits = Array.from(String(num.toFixed(0)), Number); // [1, 2, 3]
|
|
|
+ const zerosToAdd =(targetLength > digits.length)? targetLength - digits.length : digits.length; // 需要补的 0 的数量
|
|
|
const result = Array(zerosToAdd).fill(0).concat(digits);
|
|
|
return result
|
|
|
},
|