completIng(bits, identifier, value) {
value = Array(bits + 1).join(identifier) + value
return value.slice(-bits)
}
示例1:”1”格式化为”0001”
dataLeftCompleting(4, "0", 1); // 要求4位,使用“0”补齐
示例2:”1”格式化为”***1”
dataLeftCompleting(4, "*", 1); // 要求4位,使用“*”补齐