Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Currency/Clojure/currency-1.clj
Normal file
11
Task/Currency/Clojure/currency-1.clj
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(require '[clojurewerkz.money.amounts :as ma])
|
||||
(require '[clojurewerkz.money.currencies :as mc])
|
||||
(require '[clojurewerkz.money.format :as mf])
|
||||
|
||||
(let [burgers (ma/multiply (ma/amount-of mc/USD 5.50) 4000000000000000)
|
||||
milkshakes (ma/multiply (ma/amount-of mc/USD 2.86) 2)
|
||||
pre-tax (ma/plus burgers milkshakes)
|
||||
tax (ma/multiply pre-tax 0.0765 :up)]
|
||||
(println "Total before tax: " (mf/format pre-tax))
|
||||
(println " Tax: " (mf/format tax))
|
||||
(println " Total with tax: " (mf/format (ma/plus pre-tax tax))))
|
||||
9
Task/Currency/Clojure/currency-2.clj
Normal file
9
Task/Currency/Clojure/currency-2.clj
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(require '[io.randomseed.bankster.money :as m])
|
||||
|
||||
(let [burgers (m/mul #money[USD 5.50] 4000000000000000)
|
||||
milkshakes (m/mul #money[USD 2.86] 2)
|
||||
pre-tax (m/add burgers milkshakes)
|
||||
tax (m/with-rounding UP (m/mul pre-tax 0.0765))]
|
||||
(println "Total before tax: " (m/format pre-tax))
|
||||
(println " Tax: " (m/format tax))
|
||||
(println " Total with tax: " (m/format (m/add pre-tax tax))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue