Skip to content

Instantly share code, notes, and snippets.

@bodiam
Created December 18, 2013 15:51
Show Gist options
  • Select an option

  • Save bodiam/8024648 to your computer and use it in GitHub Desktop.

Select an option

Save bodiam/8024648 to your computer and use it in GitHub Desktop.
@Grapes(
@Grab(group='org.joda', module='joda-money', version='0.9')
)
import org.joda.money.*
def $(amount) {
CurrencyUnit usd = CurrencyUnit.of("USD");
Money.of(usd, amount);
}
def €(amount) {
CurrencyUnit eur = CurrencyUnit.of("EUR");
Money.of(eur, amount);
}
amount1 = € 500
amount2 = € 300
amount1 + amount2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment