Skip to content

Commit

Permalink
Typo fixes (:hald-even and "rouding").
Browse files Browse the repository at this point in the history
  • Loading branch information
Tj Gabbour committed May 7, 2015
1 parent 99462fc commit 5e14c0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/clojure/clojurewerkz/money/amounts.clj
Expand Up @@ -107,7 +107,7 @@
mode which is one of:
* java.math.RoundingMode instances
* :floor, :ceiling, :up, :down, :half-up, :half-down, :hald-even that correspond to
* :floor, :ceiling, :up, :down, :half-up, :half-down, :half-even that correspond to
java.math.RoundingMode constants with the same names
* nil for no rounding"
([^Money money ^double multiplier]
Expand All @@ -120,7 +120,7 @@
mode which is one of:
* java.math.RoundingMode instances
* :floor, :ceiling, :up, :down, :half-up, :half-down, :hald-even that correspond to
* :floor, :ceiling, :up, :down, :half-up, :half-down, :half-even that correspond to
java.math.RoundingMode constants with the same names
* nil for no rounding"
([^Money money ^double multiplier]
Expand Down Expand Up @@ -220,7 +220,7 @@
Rounding mode should be one of:
* java.math.RoundingMode instances
* :floor, :ceiling, :up, :down, :half-up, :half-down, :hald-even that correspond to
* :floor, :ceiling, :up, :down, :half-up, :half-down, :half-even that correspond to
java.math.RoundingMode constants with the same names
* nil for no rounding"
[^Money money ^long scale rounding-mode]
Expand All @@ -235,7 +235,7 @@
Rounding mode should be one of:
* java.math.RoundingMode instances
* :floor, :ceiling, :up, :down, :half-up, :half-down, :hald-even that correspond to
* :floor, :ceiling, :up, :down, :half-up, :half-down, :half-even that correspond to
java.math.RoundingMode constants with the same names
* nil for no rounding"
[^Money money ^CurrencyUnit currency multiplier rounding-mode]
Expand Down
16 changes: 8 additions & 8 deletions test/clojurewerkz/money/amounts_test.clj
Expand Up @@ -302,35 +302,35 @@
(is (= ma (ams/amount-of cu/USD 50)))))

(deftest test-round
(testing "with scale -1 and flooring rouding mode"
(testing "with scale -1 and flooring rounding mode"
(let [oa (ams/amount-of cu/USD 40.01)
ma (ams/round oa -1 :floor)]
(is (= ma (ams/amount-of cu/USD 40))))
(testing "with scale -1 and up rouding mode"
(testing "with scale -1 and up rounding mode"
(let [oa (ams/amount-of cu/USD 40.01)
ma (ams/round oa -1 :up)]
(is (= ma (ams/amount-of cu/USD 50)))))
(testing "with scale 0 and flooring rouding mode"
(testing "with scale 0 and flooring rounding mode"
(let [oa (ams/amount-of cu/USD 45.24)
ma (ams/round oa 0 :floor)]
(is (= ma (ams/amount-of cu/USD 45)))))
(testing "with scale 0 and up rouding mode"
(testing "with scale 0 and up rounding mode"
(let [oa (ams/amount-of cu/USD 45.24)
ma (ams/round oa 0 :up)]
(is (= ma (ams/amount-of cu/USD 46)))))
(testing "with scale 1 and flooring rouding mode"
(testing "with scale 1 and flooring rounding mode"
(let [oa (ams/amount-of cu/USD 45.24)
ma (ams/round oa 1 :floor)]
(is (= ma (ams/amount-of cu/USD 45.20)))))
(testing "with scale 1 and up rouding mode"
(testing "with scale 1 and up rounding mode"
(let [oa (ams/amount-of cu/USD 45.24)
ma (ams/round oa 1 :up)]
(is (= ma (ams/amount-of cu/USD 45.30)))))
(testing "with scale 2 and flooring rouding mode"
(testing "with scale 2 and flooring rounding mode"
(let [oa (ams/amount-of cu/USD 45.24)
ma (ams/round oa 2 :floor)]
(is (= ma (ams/amount-of cu/USD 45.24)))))
(testing "with scale 2 and up rouding mode"
(testing "with scale 2 and up rounding mode"
(let [oa (ams/amount-of cu/USD 45.24)
ma (ams/round oa 1 :up)]
(is (= ma (ams/amount-of cu/USD 45.30)))))))
Expand Down

0 comments on commit 5e14c0c

Please sign in to comment.