Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (34 sloc) 2.17 KB

Changes between 1.0.0-beta1 and 1.0.0

Monger Integration

clojurewerkz.money.monger, when loaded, registers BSON serializers for org.joda.money.Money and org.joda.money.CurrencyUnit. Serialization conventions used are straightforward and produce human readable values:

  • (clojurewerkz.money.currencies/USD) => "USD"
  • (clojurewerkz.money.amounts/amount-of (clojurewerkz.money.currencies/USD) 20.5) => {"currency-unit" "USD" "amount-in-minor-units" 2050}

Note that serialization is one-way: loaded documents are returned as maps because there is no way to tell them from regular BSON documents. clojurewerkz.money.monger/from-stored-map can be used to produce Money instances from maps following the serialization convention described above.

Cheshire Integration

clojurewerkz.money.json, when loaded, registers serializers for org.joda.money.Money and org.joda.money.CurrencyUnit. Serialization conventions used are straightforward and produce human readable values:

  • (clojurewerkz.money.currencies/USD) => "USD"
  • (clojurewerkz.money.amounts/amount-of (clojurewerkz.money.currencies/USD) 20.5) => "USD 20.50"

This requires Cheshire 5.0.x or later. clojure.data.json is not supported.

clojurewerkz.money.amounts/max and min

clojurewerkz.money.amounts/max and clojurewerkz.money.amounts/min are new functions that return the greater and the lesser of two monetary amounts.

clojurewerkz.money.currencies

clojurewerkz.money.currencies is a new namespace that defines vars with currency units. For example, instead of (org.joda.money.CurrencyUnit/valueOf "NOK") it is now possible to use clojurewerkz.money.currencies/NOK.

clojurewerkz.money.amounts/positive? and Related

clojurewerkz.money.amounts/positive?, clojurewerkz.money.amounts/negative?, clojurewerkz.money.amounts/positive-or-zero?, and clojurewerkz.money.amounts/negative-or-zero? are new predicate functions that work with monetary amounts.

Changes between 1.0.0-SNAPSHOT and 1.0.0-beta1

Joda Money 0.8

Joda Money was upgraded to 0.8.

Clojure 1.5 By Default

Money now depends on Clojure 1.5. It still supports 1.3+ but the default version is now 1.5.

Jump to Line
Something went wrong with that request. Please try again.