Home » Magento23 November 2009

Magento: Format Price

When you fetch product data, you get the price as integer. Now, you have to display the price with currency suffix. You can format price with the following code.

Let $_finalPrice be the integer price fetched.

To display price with currency symbol:

To display price without currency symbol:

Magento

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Pingback: Tweets that mention Magento: Format Price | Mukesh Chapagain's Blog -- Topsy.com()

  • Niyi

    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

  • awesome! thanks!

  • Mage::helper('core')->currency($_finalPrice,true,false);

    This should give you the price with currency symbol in front. If it is not so then try like this:-

    Mage::helper('core')->currency($_finalPrice,true,true);

  • Mage::helper('core')->currency($_finalPrice,true,false);

    This should give you the price with currency symbol in front. If it is not so then try like this:-

    Mage::helper('core')->currency($_finalPrice,true,true);

  • Jaishliani

    Hi,

    How to include our new Indian currency symbol in magento.?

  • Magento12

    Thanks

  • Veandro

    Thank you!

  • Vijay kumar Mahgato

    Thanks you ….

  • Bonvcihikachoun

    which file that i should add these codes?

  • Oscar

    At what part of the file do I place this code?

  • Will Patey

    how would I do this to show msrp not finalprice?

  • Susanta Kumar Das

    magento How can i get price with symbol in controller