Return-Path: X-Original-To: apmail-ofbiz-user-archive@www.apache.org Delivered-To: apmail-ofbiz-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3CE0EEF4A for ; Fri, 11 Jan 2013 10:31:24 +0000 (UTC) Received: (qmail 1520 invoked by uid 500); 11 Jan 2013 10:31:23 -0000 Delivered-To: apmail-ofbiz-user-archive@ofbiz.apache.org Received: (qmail 912 invoked by uid 500); 11 Jan 2013 10:31:23 -0000 Mailing-List: contact user-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ofbiz.apache.org Delivered-To: mailing list user@ofbiz.apache.org Received: (qmail 884 invoked by uid 99); 11 Jan 2013 10:31:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 10:31:22 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of deepak.agarwal@paxcel.net does not designate 74.125.83.44 as permitted sender) Received: from [74.125.83.44] (HELO mail-ee0-f44.google.com) (74.125.83.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 10:31:14 +0000 Received: by mail-ee0-f44.google.com with SMTP id l10so783822eei.3 for ; Fri, 11 Jan 2013 02:30:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=ZDg99pweO6KeXdFw8pitGNvua+onZiX1FaDs46CAdak=; b=mZAGfaCb0KGv3wK92cIvkT34hEZpvSYNMJ0Vbytdkkox5twUbd6TjsHCnjBI0f+P4r tiDVnumqIQrHu23n/ulEOMd06NIjNfuEWjdCmEK84uMrLOyMUSBYKNvqyqP6r6DvdORp uIpXfc3t2jq2aZnfW+X1ncqe82KqngkT8erWXKGnNAgcemForahtWBlGdQ+ueJuovqQd k9lNg8hb6gIC/Xq/Wwk1SHLo0rStGNN03q5ZrHETa6l8rdFg+SdqDDJoaISIMHCq3k8f CkPg4oaiLAjEx+BJ5ST7n+71NQXdv97p7n4yTHY5Fl3vBan66WpER8Gc/SrrI+VVBJzW bf1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type:x-gm-message-state; bh=ZDg99pweO6KeXdFw8pitGNvua+onZiX1FaDs46CAdak=; b=BfqScDHLb7OFjlDaeVFaQdPen2ZvGanzgbvUYKw6HjvlOvjEpnn9oRBnt2fqqZk5EG NLHkha7s7PvJyIgD61wuM/FCsBtUFtpJmgpkFc2j13dcGYv6wzISiU6h40ZESLCclOnA ydCvKrb1SlP62IGhN6CbZknzNRPvbDV0z2zzTyK3G04JUjTbZEn31Epb5cGKR//Lnw/l DM4rcqNW/BNKF+O27db/AwCkibW4VHxiwY50bxdL3VP3FC+RJcJSXf4NRL/O+qS6XISY 3QgYQDhvVV2jE1/iR61jPUTBWaPv7NrORAZfKIym3xxUHEKLojKQUEILScS/+o9j2S1A cAmw== Received: by 10.14.173.69 with SMTP id u45mr200933436eel.21.1357900253503; Fri, 11 Jan 2013 02:30:53 -0800 (PST) MIME-Version: 1.0 Sender: deepak.agarwal@paxcel.net Received: by 10.14.142.12 with HTTP; Fri, 11 Jan 2013 02:30:33 -0800 (PST) From: Deepak Agarwal Date: Fri, 11 Jan 2013 16:00:33 +0530 X-Google-Sender-Auth: 6pkNrf-KcqSTjtULAbGnYm13ORQ Message-ID: Subject: Bigdecimal divide causes not terminating decimal To: user@ofbiz.apache.org Content-Type: multipart/alternative; boundary=047d7b6039f4401f5c04d300ca9c X-Gm-Message-State: ALoCoQnQH5X213u07fHfO6ig1a8s7viqEojazHQWSjvNx96jspeQJT2I75pus4hQjsyOGzm5lUUg X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6039f4401f5c04d300ca9c Content-Type: text/plain; charset=ISO-8859-1 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 --047d7b6039f4401f5c04d300ca9c--