-
-
Save Daniel-Wiedemann/4a7e2f203a2583ec2879db9b4f2c74a3 to your computer and use it in GitHub Desktop.
Pad a number with leading zero in JavaScript
This file contains 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
module.exports.pad = (paramNumber) => { | |
paramNumber < 10 && paramNumber > -1 ? '0' + paramNumber : paramNumber; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment