_style = $vendorM->getData(0); } public function getDecimalSymbol() { if(!empty($this->_style)) return $this->_style->currency_decimal_symbol; } public function getThousandsSeperator() { if(!empty($this->_style)) return $this->_style->currency_thousands; } } } $currencyDisplay = new CustomCurrency(); $decimalSymbol = $currencyDisplay->getDecimalSymbol(); $thousandsSeparator = $currencyDisplay->getThousandsSeperator(); if (preg_match('/[\.\d' . $decimalSymbol . $thousandsSeparator . ']+/', trim($product['subtotal_with_tax']), $matches)) { $price = $matches[0] / $product['quantity']; $leftCurrency = ''; $rightCurrency = ''; $tmp = trim(str_replace($matches[0], '{s}', $product['subtotal_with_tax'])); if ('' !== $tmp) { $parts = explode('{s}', $tmp); if ('' !== trim($parts[0])) $leftCurrency = $parts[0]; else $rightCurrency = $parts[1]; } if(!class_exists('calculationHelper')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'calculationh.php'); $calculator = calculationHelper::getInstance (); $calculator->_roundindig = 0; echo $leftCurrency . $calculator->roundInternal($price, 'salesPrice') . $rightCurrency; } else { echo $product['subtotal_with_tax']; } ?>