Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Amounts not rounded in invoice for product with taxes View modes: 
User avatar
Member
Member
nicolas.juteau-nexun - 12/21/2011 2:21:34 PM
   
Amounts not rounded in invoice for product with taxes
Hello everyone,

If I apply some taxes on a product and see the generated invoice, the subtotal shown, total price and taxes summary amounts are not rounded. (5,6392875$ CAD)

Is there a way to quick fix this ?

For your information: In CMS Desk -> Ecommerce -> Configuration -> Currencies -> My main currency, Significant digits is already set to 2.

Thanks all,

Nicolas

User avatar
Member
Member
nicolas.juteau-nexun - 12/22/2011 9:13:15 AM
   
RE:Amounts not rounded in invoice for product with taxes
Ok, I have found a quick way to fix this.

Using the CustomShoppingCartInfoProvider and CustomShoppingCartItemInfoProvider, overloading the methods that does the calculation for prices and make them return Math.Round(number, 2) does the trick.

I just wonder why it isn't rounded out of the box ?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/24/2011 3:38:24 AM
   
RE:Amounts not rounded in invoice for product with taxes
Hi,

In the code is used standard ASP.Net math function and its behavior is sometimes weird.
Searching our forums you can find several threads on this topic as well as a KB article.

Best regards,
Juraj Ondrus