            (apply str (repeat l \space))
            s
            (apply str (repeat r \space)))))
+
+     :currency-format
+     (fn [n]
+       (throw-when-expecting-number n)
+       (let [n (double n)]
+         (.format ^NumberFormat currency-format n)))
+
+     :number-format
+     (fn [n fmt]
+       (throw-when-expecting-number n)
+       (format fmt n))
 
      ;;; Format a date, expects an instance of DateTime (Joda Time) or Date.
      ;;; The format can be a key from valid-date-formats or a manually defined format

   "fullTime"        (DateTimeFormat/fullTime)
   "fullDateTime"    (DateTimeFormat/fullDateTime)
   })

(defn ^DateTime fix-date
  [d]

            [selmer.util :refer [exception]])
  (:import [org.joda.time DateTime]
           [org.joda.time.format DateTimeFormat DateTimeFormatter]
           [org.apache.commons.codec.digest DigestUtils]
           [java.text NumberFormat]))

(def valid-date-formats
  {"shortDate"       (DateTimeFormat/shortDate)
