I think i've got it (EUREKA) ;-)
This is what my code looks like now, Line 160 til 180, in /includes/functions/functions_taxes.php:
PHP Code:
// Add tax to a products price based on whether we are displaying tax "in" the price
function zen_add_tax($price, $tax) {
global $currencies;
if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
$tax = $price * $tax / 100;
$priceInclTax = $price + $tax;
$priceInclTaxFormatted = zen_round($priceInclTax, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
return $priceInclTaxFormatted;
} else {
return zen_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
}
}
// Calculates Tax rounding the result
function zen_calculate_tax($price, $tax) {
global $currencies;
$result = bcmul($price, $tax, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
$result = bcdiv($result, 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
return $result;
return zen_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
}
Tax 19% 4,256 is now rounded off at 4,26 and NOT 4,27
Bookmarks