Skip to content

Grails plugin for manage money and currency exchange

License

Notifications You must be signed in to change notification settings

ticketbis/grails-money

Repository files navigation

grails-money

Build Status

Grails plugin for money and currency exchange management

Build and install in local repository

$ grails package-plugin
$ grails maven-install

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')

About

Grails plugin for manage money and currency exchange

Resources

License

Stars

Watchers

Forks

Packages

No packages published