Magento format price currency


Magento format price currency: In magento we need to format integer values to price in their respective currency. You can format price with currency symbol or without current symbol. By Default currency symbol($22.50) is added in magento here we are going to cover both situation with and without current syn


Magento format price currency

Here are both conditions to format currency in magento –

Magento format price with currency

You can format price with currency as below –

Magento format price with currency

$priceWitCurrency = Mage::helper('core')->currency($finalPrice, true, false);

The example will format price with currency symbol.

Magento format price without currency

You can format price without currency as below –

Magento format price without currency

$priceWitoutCurrency = Mage::helper('core')->currency($finalPrice, array('display' => Zend_Currency::NO_SYMBOL));


The example will format price without currency symbol.


Advertisements

Add Comment

📖 Read More