/ Published in: JavaScript
Example:
`addZeros((549).toString(),7);`
Returns:
`"0000549"`
`addZeros((549).toString(),7);`
Returns:
`"0000549"`
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function addZeros(score,digits) { if(score.length >= digits) { return score; } return addZeros("0"+score,digits); }