1

How can I change format a price with giving some specific currency code?

I search it on google but only thing which I find is to format price based on selected currency.

But I want to format that price with a specific currency.

Is there is any way to do that??

Any help will be appreciated.

  • Mage::app()->getLocale()->currency('EUR')->toCurrency($price); did you tried that – Qaisar Satti Apr 27 '16 at 7:22
  • No just tried it.. and works fine! If you can add it as a answer then i can mark it as accept and upvote to you for all community users – Asish Hira Apr 27 '16 at 7:29
2

you can format price with below code.

$price=10;
$symbol=Mage::app()->getLocale()->currency('EUR')->getSymbol();
$fromatprice=str_replace($symbol,'',Mage::app()->getLocale()->currency('EUR')->toCurrency($price)); 
  • can you tell me that how can i remove currency code from the result?? – Asish Hira Apr 27 '16 at 7:34
  • added the solution hope work for you.. – Qaisar Satti Apr 27 '16 at 7:37
  • Really you are very intelligent. Thanks for your help – Asish Hira Apr 27 '16 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.