Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js num to string with leading 0

String(<number>).padStart(<places>, '0')

String(42).padStart(5, '0'); 	// '00042'
 
PREVIOUS NEXT
Tagged: #js #num #string #leading
ADD COMMENT
Topic
Name
1+3 =