-
-
Save drewbo/7cacca4678c2e6c18b65 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defn zp "Zero Pad numbers - takes a number and the length to pad to as arguments" | |
[n c] | |
(loop [s (str n)] | |
(if (< (.length s) c) | |
(recur (str "0" s)) | |
s))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment