BigDecimal类使用

1.加法

String a1 = "123.5";
String a2 = "123.5";
BigDecimal bigDecimal = new BigDecimal(a1);
BigDecimal bigDecimal1 = new BigDecimal(a2);
Double res = bigDecimal.add(bigDecimal1);
posted @ 2023-08-16 19:10  lwx_R  阅读(13)  评论(0)    收藏  举报