summaryrefslogtreecommitdiff
path: root/src/utils.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.clj')
-rwxr-xr-xsrc/utils.clj11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils.clj b/src/utils.clj
index 779bb7b..8bd8291 100755
--- a/src/utils.clj
+++ b/src/utils.clj
@@ -108,6 +108,17 @@
;; Formatters
+(defn- comma-helper [s]
+ (let [f (take 3 s)
+ r (drop 3 s)]
+ (if (= (count r) 0)
+ f
+ (append (comma-helper r) [\,] (reverse f)))))
+
+(defn comma-format [i]
+ (apply str
+ (reverse (comma-helper (reverse (str i))))))
+
(def yyyy-mm-dd-formatter (new SimpleDateFormat "yyyy-MM-dd"))
(defn format-yyyy-mm-dd [d]