clojure
clojure copied to clipboard
Rounding numbers - decimal to integer
what is the idiomatic way of rounding numbers?
(format ".%2f" val) ;; okay for printing / display
(-> val (* 100) Math/round (/ 100)) ;; preferred when using as a value