Number Things

Precede with zeros

Format the number of digits in your number.

Simply passing your number to the following function applies any zeros that are required.
Set the number of digits required at variable totalDigits and if a number has less than this value the appropriate number of zeros are added to the beginning of the number.

totalDigits=4

function addZeros(n){
num = n.toString()

if(isNaN(num)){ // check if number
return num
}

while(num.length < totalDigits){
num = '0'+num
}
return num
}
Original
4 digit format


Divide

Divide a whole number into set groups.

Divide into groups of
 

 

 

Coming Soon