Grails plugin for manage money and currency exchange
Groovy Batchfile
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
grails-app
scripts
src/groovy/com/ticketbis/money
test/unit/com/ticketbis/money
web-app/WEB-INF
wrapper
.classpath
.gitignore
.project
.travis.yml
LICENSE
MoneyGrailsPlugin.groovy
README.md
application.properties
grailsw
grailsw.bat

README.md

grails-money

Build Status

Grails plugin for money and currency exchange management

Installation

Add dependency to your BuildConfig;

compile "com.ticketbis:money:0.1.21"

Usage

import com.ticketbis.money.*

def money = new Money(100, 'EUR')

money.amount == 100.00G
money.currency == Currency.getInstance('EUR')

// Comparing money
money == new Money('100 EUR') // true
money == new Money('100 USD') // false
money != new Money('250 EUR') // true

// Arithmetic
new Money('100 EUR') / 2 == new Money('50 EUR')
new Money('100 EUR') * 2 == new Money('200 EUR')
new Money('100 EUR') + new Money('20 EUR') == new Money('120 EUR')