Magento Formating Price
Magento provides build-in method to support the price formatting accordingly. There are the couple of methods in magento to format price. The method below is easiest to get the formatted price in selective currency:
Mage::helper('core')->currency($price,$format,$includeContainer)
Above syntax can be demonstrated by the below example:
<?php echo $currencyPrice = Mage::helper('core')->currency(13.0921,true,false); ?>
Depending on your currency the above value be printed in formated amount. For instance if your currency is $ then it will print $13.09 If your currency is Euro it will be: €13.09
Sometimes you don’t need currency symbols or you just need to display the currency symbol. To do use the code below:
Mage::getModel('directory/currency')->setData( 'currency_code',Mage::app()->getStore(null)->getCurrentCurrency()->getCode() ) -> format( $productPrice, array ( 'display' => Zend_Currency::NO_SYMBOL), false ) );
The above code removes the currency symbol and displays the formatted price. Likewise you can use currency symbol, currency short name or currency name. The value of ‘display’ key varies according to the constant value.
Zend_Currency::NO_SYMBOL // 13.09 Zend_Currency::USE_SYMBOL // $13.09 Zend_Currency::USE_SHORTNAME // USD13.09 Zend_Currency::USE_NAME // DOLLER13.09