Possible Duplicate:
Is there a JavaScript function that can pad a string to get to a determined length?
What's the simplest way to left pad a string in javascript?
I'm looking for an inline expression equivalent to mystr.lpad("0", 4)
: for mystr='45'
would return 0045
.