String.prototype.lpad, .rpad(fillLen, fillStr = ' ') seems to work now correctly