java bigdecimal money

* @param amount is required, can be positive or negative. * many operations return new Money objects. */, /** money type based on BigDecimal. * See {@link BigDecimal}. In Java, the BigDecimal class has several methods that let you convert BigDecimal values to strings, doubles, or integers. * An important exception to this rule is that {@link #equals(Object)} is sensitive * constructor (25.00, 25.0, 25, etc). Again, I’m not going to discuss this much; I’m just sharing this code here so I can remember how I solved this problem today. When roundCeiling is false we round toward the floor, so in that case *

  • a + b : max[ scale(a), scale(b) ] Calling this */, /** *
  • a / b : scale(a) - scale(b) * BigDecimal.ROUND_FLOOR behave. *