Skip to content

Instantly share code, notes, and snippets.

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

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.