Skip to content

Instantly share code, notes, and snippets.

@ctbarna
Created August 2, 2012 00:48
Show Gist options
  • Save ctbarna/3232028 to your computer and use it in GitHub Desktop.
Save ctbarna/3232028 to your computer and use it in GitHub Desktop.
Number::toPaddedString = (radix, digits=2) ->
str = this.toString(radix)
while str.length < digits
str = "0" + str
str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment