package com.sandu.common.util; import java.math.BigDecimal; /** * @author chenjiantian * @date 2021/9/17 15:09 */ public class BigDecimalUtil { public static BigDecimal add(BigDecimal one, BigDecimal other) { if (one == null) { return other; } if (other == null) { return one; } return one.add(other); } /** * 获取两个最小 * */ public static BigDecimal min(BigDecimal one, BigDecimal other) { if (one.compareTo(other) > 0) { return one; } else { return other; } } }