Skip to content

Instantly share code, notes, and snippets.

@appositum
Created May 1, 2019 22:55
Show Gist options
  • Save appositum/21bd2eba9233304914fd20eafd517290 to your computer and use it in GitHub Desktop.
Save appositum/21bd2eba9233304914fd20eafd517290 to your computer and use it in GitHub Desktop.
zfill :: Int -> String -> String
zfill n str = do
if length str >= n
then str
else replicate (n - length str) '0' ++ str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment