Skip to content
Snippets Groups Projects
Commit 33a00319 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

add a very simple (format-num) function.

parent 455fb53a
Branches
Tags
No related merge requests found
......@@ -115,6 +115,17 @@
[format-string]
(time/unparse (time/formatter format-string) (coerce/from-long (System/currentTimeMillis))))
(defn format-num
"format a number into a more human readable form."
[number]
{:pre [(number? number)]}
(if (or (float? number)
(decimal? number))
;; looks like this is a decimal number, format with precision of 2
(format "%,.2f" number)
;; otherwise expect this is a whole number
(format "%,d" number)))
(defn jdbc-clob->str
"Convert a `JdbcClob` or `PGobject` to a `String`."
(^String
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment