Adds pedantic flag

This commit is contained in:
2025-11-05 20:57:54 -08:00
parent a462c56595
commit bd8cb34a0f
3 changed files with 10 additions and 6 deletions

View File

@@ -17,6 +17,8 @@
(java.text DecimalFormat)
(java.util UUID)))
(def ^:dynamic *report-pedantic* false)
(defn cell->pdf [cell]
(let [cell-contents (cond
(and (= :dollar (:format cell))
@@ -28,7 +30,7 @@
(.format (DecimalFormat. "$###,##0.00") (:value cell))
(= :percent (:format cell))
(.format (DecimalFormat. "0%") (:value cell))
(.format (DecimalFormat. (if *report-pedantic* "0.00%" "0%")) (:value cell))
:else
(str (:value cell)))]