Skip to content

Instantly share code, notes, and snippets.

@nfma
Created February 7, 2012 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfma/1761273 to your computer and use it in GitHub Desktop.
Save nfma/1761273 to your computer and use it in GitHub Desktop.
(defn commatize [n]
(if n
(->> n
str
reverse
(partition-all 3)
(interpose \,)
flatten
reverse
         (apply str))
""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment