I was looking at ways to make this faster, but frankly I think this is fine. However, if you care, this is neat: http://jsperf.com/ways-to-0-pad-a-number/20

No action required.