Magento Format Price To Default Currency

Use the below code to format a price according to default currency in Magento

$price = $_product->getPrice() 
/// This is in product details page. 
/// Replace it with necessary price value according to your requirement.
$formatted price = Mage::helper('core')->currency($price);

2 comments

  1. Hello

    This is a bit close to what I have been looking for. I called the prices for my products to the homepage using getFinalPrice() ?>. The Problem I am having is that a product that appears to be $1,000 on its product pages appeared as 1000.0000. I have tried all my little ideas of magento but still cannot get past this. The currency symbol is missing too.
    How can I resolve this jam? Any help will be appreciated please.
    Thanks

Leave a comment

Your email address will not be published. Required fields are marked *