添加bigdecimal方法

This commit is contained in:
hope-xu 2022-05-20 17:15:24 +08:00
parent 3ebd7d9ce0
commit ca6514e0a3

View File

@ -2766,4 +2766,15 @@ public class NumberUtil {
}
}
// ------------------------------------------------------------------------------------------- Private method end
/**
* null转换为BigDecimal<br>
*
* @param bigDecimal 被转换的值
* @return BigDecimal
* @since 5.8.1
*/
public static BigDecimal nullToZero(BigDecimal bigDecimal) {
return bigDecimal == null ? BigDecimal.ZERO : bigDecimal;
}
}