Skip to content

Instantly share code, notes, and snippets.

@koji
Created June 21, 2020 04:33
Show Gist options
  • Save koji/dfceb4b5b3071d865ee173446a127ea3 to your computer and use it in GitHub Desktop.
Save koji/dfceb4b5b3071d865ee173446a127ea3 to your computer and use it in GitHub Desktop.
const num = 1;
const ret = ( '000' + num ).slice( -3 );
console.log(ret);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment