Prepend to numbers - Javascript

Prepend to numbers - Javascript

code snippet

javascript
function prependTonumber(n, width, z) {
  z = z || '0';
  n = n + '';
  return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}

"Thinking: the talking of the soul with itself"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.