|
|
|
|
|
by wtbob
3687 days ago
|
|
This is simple: if (str.length < 6) {
str = ' '.repeat(6-str.length) + str;
}
This is easy: leftPad = require('left-pad')
leftPad(str, 6)
(note: my JavaScript is rusty; there may be some very valid reason that the simple code is wrong) |
|