You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Abhishake Agarwal <ab...@gmail.com> on 2009/10/26 09:08:24 UTC
Need Help for rounding problem
Hi,
We are showing products with VAT included.
Following are the details:
*Price of product without Tax:* 34.78
*% Vat:* 15%
*Price of Product after Tax:* 39.997
*Price of Product after Tax on product detail screen when rounded to 2
decimals:* 40 (as last decimal is 7 its rounded up)
*Suppose user add 2 products to cart, then the total price of product will
be:* 79.994
*Price shown on Cart screen and Checkout screen is*: 79.99 (as last decimal
is 4).
In the above example if customer add single product to cart price will be 40
but for 2 product it will be 79.99.
What is required is that first single product price is calculated and then
quantity should be multiplied so that customer can see the price in multiple
of 40.
Please help me on this.
Regards,
Abhishake
Re: Need Help for rounding problem
Posted by Jacques Le Roux <ja...@les7arts.com>.
Not much time, but maybe related to
https://issues.apache.org/jira/browse/OFBIZ-224
https://issues.apache.org/jira/browse/OFBIZ-1007
HTH
Jacques
From: "Abhishake Agarwal" <ab...@gmail.com>
> Hi,
>
> We are showing products with VAT included.
>
> Following are the details:
>
> *Price of product without Tax:* 34.78
>
> *% Vat:* 15%
>
> *Price of Product after Tax:* 39.997
>
> *Price of Product after Tax on product detail screen when rounded to 2
> decimals:* 40 (as last decimal is 7 its rounded up)
>
> *Suppose user add 2 products to cart, then the total price of product will
> be:* 79.994
>
> *Price shown on Cart screen and Checkout screen is*: 79.99 (as last decimal
> is 4).
>
> In the above example if customer add single product to cart price will be 40
> but for 2 product it will be 79.99.
>
> What is required is that first single product price is calculated and then
> quantity should be multiplied so that customer can see the price in multiple
> of 40.
>
> Please help me on this.
>
>
> Regards,
> Abhishake
>
Re: Need Help for rounding problem
Posted by Abhishake Agarwal <ab...@gmail.com>.
Hi,
Actually toScale of bigdecimal is already implemented which take value from
arithmetic.properties.
I have tried various combination in arithmetic.properties its not working,
The reason is what ofbiz does is first calculate the total price of same
product(i.e. if there are 2 same items ) and then its add the tax.
Regards,
Abhishake
On Mon, Oct 26, 2009 at 1:41 PM, Bhupendra Shivade <
Bhupendra_Shivade@mindtree.com> wrote:
> Use Bigdecimal toScale method.
>
>
> -----Original Message-----
> From: Abhishake Agarwal [mailto:abhishake.agarwal@gmail.com]
> Sent: Monday, October 26, 2009 1:38 PM
> To: user@ofbiz.apache.org
> Subject: Need Help for rounding problem
>
> Hi,
>
> We are showing products with VAT included.
>
> Following are the details:
>
> *Price of product without Tax:* 34.78
>
> *% Vat:* 15%
>
> *Price of Product after Tax:* 39.997
>
> *Price of Product after Tax on product detail screen when rounded to 2
> decimals:* 40 (as last decimal is 7 its rounded up)
>
> *Suppose user add 2 products to cart, then the total price of product will
> be:* 79.994
>
> *Price shown on Cart screen and Checkout screen is*: 79.99 (as last decimal
> is 4).
>
> In the above example if customer add single product to cart price will be
> 40
> but for 2 product it will be 79.99.
>
> What is required is that first single product price is calculated and then
> quantity should be multiplied so that customer can see the price in
> multiple
> of 40.
>
> Please help me on this.
>
>
> Regards,
> Abhishake
>
> http://www.mindtree.com/email/disclaimer.html
>
RE: Need Help for rounding problem
Posted by Bhupendra Shivade <Bh...@mindtree.com>.
Use Bigdecimal toScale method.
-----Original Message-----
From: Abhishake Agarwal [mailto:abhishake.agarwal@gmail.com]
Sent: Monday, October 26, 2009 1:38 PM
To: user@ofbiz.apache.org
Subject: Need Help for rounding problem
Hi,
We are showing products with VAT included.
Following are the details:
*Price of product without Tax:* 34.78
*% Vat:* 15%
*Price of Product after Tax:* 39.997
*Price of Product after Tax on product detail screen when rounded to 2
decimals:* 40 (as last decimal is 7 its rounded up)
*Suppose user add 2 products to cart, then the total price of product will
be:* 79.994
*Price shown on Cart screen and Checkout screen is*: 79.99 (as last decimal
is 4).
In the above example if customer add single product to cart price will be 40
but for 2 product it will be 79.99.
What is required is that first single product price is calculated and then
quantity should be multiplied so that customer can see the price in multiple
of 40.
Please help me on this.
Regards,
Abhishake
http://www.mindtree.com/email/disclaimer.html