7 lines
120 B
JavaScript
7 lines
120 B
JavaScript
|
'use strict'
|
||
|
module.exports = (d, num) => {
|
||
|
num = String(num)
|
||
|
while (num.length < d) num = '0' + num
|
||
|
return num
|
||
|
}
|