1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| 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;
| }
| }
| }
|
|