This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git
The following commit(s) were added to refs/heads/trunk by this push: new f8a34b664 Improved: Replace deprecated BigDecimal.ROUND_HALF by RoundingMode.HALF (OFBIZ-13103) f8a34b664 is described below commit f8a34b664d0fa8dce4e3751591fe594c1877fb11 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Fri May 24 15:45:21 2024 +0200 Improved: Replace deprecated BigDecimal.ROUND_HALF by RoundingMode.HALF (OFBIZ-13103) Address this deprecation int java.math.BigDecimal.ROUND_HALF_UP Deprecated. Use RoundingMode.HALF_UP instead. Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. Behaves as for ROUND_UP if the discarded fraction is ≥ 0.5; otherwise, behaves as for ROUND_DOWN. Note that this is the rounding mode that most of us were taught in grade school. --- birt/webapp/ordermgr/reports/CouponSalesReport.rptdesign | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/birt/webapp/ordermgr/reports/CouponSalesReport.rptdesign b/birt/webapp/ordermgr/reports/CouponSalesReport.rptdesign index 67ae3a414..b44f4f0af 100644 --- a/birt/webapp/ordermgr/reports/CouponSalesReport.rptdesign +++ b/birt/webapp/ordermgr/reports/CouponSalesReport.rptdesign @@ -188,14 +188,14 @@ if(productPromoCodes.size()>0){ shippingCharge = 0; shippingCharge = orderAdjustments.get(j).get("amount"); if(shippingCharge){ - shippingCharge = shippingCharge.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + shippingCharge = shippingCharge.setScale(2, RoundingMode.ROUND_HALF_UP).doubleValue(); } totalShippingCharge = totalShippingCharge + shippingCharge; } shippingAmount = dispatcher.runSync("getOrderShippingAmount", input); amount = shippingAmount.get("shippingAmount"); if(amount){ - amount = amount.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + amount = amount.setScale(2, RoundingMode.ROUND_HALF_UP).doubleValue(); } totalShippingAmount = totalShippingAmount + amount; }