Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A comma for thousands separator in Clojurescript using goog closure libs.
(ns client.ui
(goog.i18n NumberFormat)
(goog.i18n.NumberFormat Format)))
(def nff
(NumberFormat. Format/DECIMAL))
(defn- nf
(.format nff (str num)))

This comment has been minimized.

Copy link

palakmathur commented Dec 22, 2016

This looks great. I had a similar solution in mind. Tried all the format patterns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.