PadLeft with zero for index.
npm install -S @jswork/next-pad-index
{ char: '0', step: 0, size: 2 }
api | type | default |
---|---|---|
char | string | '0' |
step | number | 0 |
size | number | 2 |
import '@jswork/next-pad-index';
// default options:
nx.padIndex(2); // 002
nx.padIndex(100); // 100
// with options:
nx.padIndex(100, { step: 1}) //101
Code released under the MIT license.