Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Joda is impressive and has great performance.

The examples were written using the infix notation but you can just use regular method calls. For example:

val price = Money.of(100, "USD")

val shipping = Money.of(5, "USD")

val subtotal = price.plus(shipping)

val discount = Percentage.of(10)

val total = subtotal.decreaseBy(discount)

total.allocate(2)

total.allocate(60.percent(), 40.percent())



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: