摘要:
在做项目时,经常用到BigDecimal类型的数据,需要比较大小:声明 BigDecimal: BigDescimal bd = new BigDecimal(str1);Integer a = bd1.compareTo(bd2); a = -1,表示bd1小于bd2; a = 0,表示bd1等于 阅读全文
posted @ 2021-12-29 15:29
西门长海
阅读(1601)
评论(0)
推荐(0)
摘要:
@NotNullThe annotated element must not be {@code null}. 校验参数一定不能为null,但是可以为" "。 @NotEmptyThe annotated element must not be {@code null} nor empty. Sup 阅读全文
posted @ 2021-12-29 10:27
西门长海
阅读(817)
评论(0)
推荐(0)
摘要:
BigDecimal.setScale()方法用于格式化小数点setScale(1)表示保留一位小数,默认用四舍五入方式setScale(1,BigDecimal.ROUND_DOWN)直接删除多余的小数位,如2.35会变成2.3setScale(1,BigDecimal.ROUND_UP)进位处理 阅读全文
posted @ 2021-12-29 09:53
西门长海
阅读(140)
评论(0)
推荐(0)

浙公网安备 33010602011771号