Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js append zeros

var str = "5";
alert(str.lpad("0", 4)); //result "0005"
var str = "10"; // note this is string type
alert(str.lpad("0", 4)); //result "0010"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #append #zeros
ADD COMMENT
Topic
Name
7+3 =