Created
August 25, 2014 08:57
-
-
Save A/81887137495685b4b391 to your computer and use it in GitHub Desktop.
Add leading zeros to number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var addLeadingZero = function (pos) { | |
| pos = pos + ''; | |
| while (position.length < 3) { | |
| position = '0' + position; | |
| } | |
| return pos; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment