UNPKG

lenye_base

Version:

基础方法

14 lines (11 loc) 245 B
'use strict'; /** * Increase by 0 based on string length before string */ function fillZero(target, n) { var z = new Array(n).join('0'); var str = z + target; var result = str.slice(-n); return result; } module.exports = fillZero;