Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Tax rounding problem


hh205

Recommended Posts

Hi,

 

How do I control the rounding when tax is added? I have a product where the final price should be SEK 59.50 including 12% VAT. Furthermore I want the price including VAT to show in the store.

 

When I enter a gross price of 59.50 it calculates the net price to 53.125, but when the item is updated it rounds up to 53.13 and the shown gross price in the store turns to 59.51 this is VERY annoying. It can be solved by using 3 decimals for the currency but it don't want to have prices like 59.500 showing. If anyone has any tips how I can come around this issue (mod of formula, decimal number trick ?????) I would be very grateful!!

 

/Hannes

Link to comment
Share on other sites

The catalog will display only two decimal places - regardless of what you see in admin. I don't think that the javascript/tax amount you see in the admin/products/categories page is saved to the database - it is there for your convenience only.

 

The tax functions may be found in catalog/includes/functions/general.php - this is the rounded tax calculation function (it also uses tep_round):

 

// Calculates Tax rounding the result
?function tep_calculate_tax($price, $tax) {
? ?global $currencies;

? ?return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
?}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...