The ClojureWerkz Blog

News and updates about ClojureWerkz projects

Money 1.1.0 Is Released

Money is a Clojure library that deals with monetary amounts and currencies, built on top of Joda Money.

1.1.0 is a minor release that contains one breaking API change, contains minor improvements and upgrades dependencies.

Changes between Money 1.0.0 and 1.1.0

Comparison Functions

It is possible to compare monetary amounts using >, >=, < and <=.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
(require '[clojurewerkz.money.amounts    :as ma])
(require '[clojurewerkz.money.currencies :as mc])

(ma/< (ma/amount-of mc/USD 100) (ma/amount-of mc/USD 100))
;= false

(ma/<= (ma/amount-of mc/USD 100) (ma/amount-of mc/USD 100) (ma/amount-of mc/USD 120))
;= true

(ma/>= (ma/amount-of mc/USD 100) (ma/amount-of mc/USD 100) (ma/amount-of mc/USD 120))
;= false

(ma/> (ma/amount-of mc/USD 200) (ma/amount-of mc/USD 100))
;= true

Contributed by Ben Poweski.

Change Log

Money change log is available on GitHub.

Money is a ClojureWerkz Project

Money is part of the group of libraries known as ClojureWerkz, together with

  • Elastisch, a minimalistic Clojure client for ElasticSearch
  • Monger, a Clojure MongoDB driver for a more civilized age
  • Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
  • Welle, a Riak client with batteries included
  • Neocons, a client for the Neo4J REST API
  • Quartzite, a powerful scheduling library

and several others. If you like Money, you may also like our other projects.

Let us know what you think on Twitter or on the Clojure mailing list.

@michaelklishin on behalf of the ClojureWerkz Team