Skip to content

Commit

Permalink
Fix ns sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
nnichols committed Oct 13, 2024
1 parent 0004288 commit 31cf613
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/brewtility/precision.cljc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(ns brewtility.precision
"Namespace for handling numeric precision, rounding, and approximation."
{:added "1.0"}
#?(:clj (:import [java.math RoundingMode])))
{:added "1.0"})


(defn approximates?
Expand All @@ -25,7 +24,7 @@
:see-also ["->1dp" "->2dp" "->3dp"]}
[^double x ^long num-decimals]
(double
#?(:clj (.setScale (bigdec x) num-decimals RoundingMode/HALF_UP)
#?(:clj (.setScale (bigdec x) num-decimals java.math.RoundingMode/HALF_UP)
:cljs (let [denominator (Math/pow 10.0 (double num-decimals))
numerator (Math/round (* x denominator))]
(/ numerator denominator)))))
Expand Down

0 comments on commit 31cf613

Please sign in to comment.