ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Agarwal <dagarwa...@gmail.com>
Subject Bigdecimal divide causes not terminating decimal
Date Fri, 11 Jan 2013 10:30:33 GMT
InvoiceServices.java :

billingAmount =
billingAmount.subtract(amountAlreadyIncluded.divide(billingQuantity));

This sometimes causes non terminating decimal problem. Should we use
instead:

billingAmount = billingAmount.subtract(new
BigDecimal(amountAlreadyIncluded.doubleValue()/(billingQuantity.doubleValue())));

-- 
Thanks,
Deepak Agarwal,

Mobile: +91 9501190044

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message