Rounding the second decimal

General Support for technical Issues relating to AlegroCart
Post Reply
Oistacus
Posts: 133
Joined: Sat Oct 08, 2011 3:21 pm
Location: Matera ITALY

Rounding the second decimal

Post by Oistacus » Mon Nov 14, 2011 9:44 am

Hi ,
I have a small problem with a roundig the second decimal incluse VAt .

e.g € 9.55 + 10% vat = 10,505 -> I see € 10,51 . I would see € 10,50 .

if i set 9.54 -> 10,494. I see € 10,49 . There is a method to truncate and rounding the second decimal ?
In option product I can insert 4 decimal , in product if I insert 4 decimal , it save only 2 decimal .
I try to insert e.g. € 9.5454 , but when I reload the product ( in admin ) I got 9.55
Is a problem of setting database ?

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Rounding the second decimal

Post by Brent » Mon Nov 14, 2011 10:02 am

The product is set to use the number of decimal digits you have set up in settings.
If you set to 2, then that is what will show in product.
If you round 10,505 , it should round to 10,51. If the decimal to round is 1/2(.5) or more, it should round up.

Oistacus
Posts: 133
Joined: Sat Oct 08, 2011 3:21 pm
Location: Matera ITALY

Re: Rounding the second decimal

Post by Oistacus » Mon Nov 14, 2011 10:14 am

Brent wrote:The product is set to use the number of decimal digits you have set up in settings.
If you set to 2, then that is what will show in product.
If you round 10,505 , it should round to 10,51. If the decimal to round is 1/2(.5) or more, it should round up.
Is the Currency Surcharge that I must to set ?

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Rounding the second decimal

Post by Brent » Mon Nov 14, 2011 10:31 am

Sorry, it's not settings. It's in currency. If you have the decimal places set to 2, that is your rounding point.
The reason it is like this is if you sell a product that is 10.944, the value for 1 would be shown as 10.94.
If you sell 2, the extended vale would be 21.89. This is not correct. you would only display 21.88 if you don number formatting, but if you do further calculations, it would be based on a value of 21.888 which would stack incorrect results.

Oistacus
Posts: 133
Joined: Sat Oct 08, 2011 3:21 pm
Location: Matera ITALY

Re: Rounding the second decimal

Post by Oistacus » Mon Nov 14, 2011 10:43 am

Brent wrote:Sorry, it's not settings. It's in currency. If you have the decimal places set to 2, that is your rounding point.
The reason it is like this is if you sell a product that is 10.944, the value for 1 would be shown as 10.94.
If you sell 2, the extended vale would be 21.89. This is not correct. you would only display 21.88 if you don number formatting, but if you do further calculations, it would be based on a value of 21.888 which would stack incorrect results.
Ok , I understand it . Is not nice ( 100.01 or 99.99 ) , but , in the currency could be implemented this function : rounding at first , second or third decimal .
What you think about it ?
Now , I set all prices because the website is ready to start and I see this result .

soennar
Posts: 10
Joined: Tue Mar 27, 2012 3:05 pm

Re: Rounding the second decimal

Post by soennar » Thu Mar 29, 2012 1:05 am

Sorry I wanna to ask: how to delete 2 decimal for currency..

Thanks...

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Rounding the second decimal

Post by leo » Thu Mar 29, 2012 4:50 am

Go to Admin/Configuration/Localization/Currency.
Choose your currency and change decimal places to 0.

soennar
Posts: 10
Joined: Tue Mar 27, 2012 3:05 pm

Re: Rounding the second decimal

Post by soennar » Thu Mar 29, 2012 9:50 am

Ok, thanks...

Post Reply