示例#1
0
 /**
  * Rounds a value.
  *
  * <p>The value is rounded using {@link java.math.RoundingMode#HALF_UP} rounding convention.
  *
  * @param value the value
  * @param scale the no. of decimal places
  * @return the rounded value
  */
 public BigDecimal round(BigDecimal value, int scale) {
   return MathRules.round(value, scale);
 }
示例#2
0
 /**
  * Rounds an amount.
  *
  * <p>This implementation rounds to 2 decimal places. TODO - this should round according to
  * practice rounding conventions.
  *
  * @param amount the amount to round.
  * @return the rounded amount
  */
 public BigDecimal roundAmount(BigDecimal amount) {
   return MathRules.round(amount, 2);
 }