js - 补零
String(this.formatZero(this.sumCount, 5));
formatZero(num: any, len: any) {
if (String(num).length > len) return num;
return (Array(len).join("0") + num).slice(-len);
}
学贵有恒,而行胜于言
String(this.formatZero(this.sumCount, 5));
formatZero(num: any, len: any) {
if (String(num).length > len) return num;
return (Array(len).join("0") + num).slice(-len);
}