Skip to content

Instantly share code, notes, and snippets.

@tjmahr
Created March 5, 2015 14:19
Show Gist options
  • Save tjmahr/8a15b1c27056bb63d66b to your computer and use it in GitHub Desktop.
Save tjmahr/8a15b1c27056bb63d66b to your computer and use it in GitHub Desktop.
leading zeros
sprintf("%03.f", seq_len(20))
# [1] "001" "002" "003" "004" "005" "006" "007" "008" "009" "010"
#[11] "011" "012" "013" "014" "015" "016" "017" "018" "019" "020"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment