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.

2
  • Mage::app()->getLocale()->currency('EUR')->toCurrency($price); did you tried that Apr 27, 2016 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, 2016 at 7:29

1 Answer 1

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)); 
3
  • can you tell me that how can i remove currency code from the result??
    – Asish Hira
    Apr 27, 2016 at 7:34
  • added the solution hope work for you.. Apr 27, 2016 at 7:37
  • Really you are very intelligent. Thanks for your help
    – Asish Hira
    Apr 27, 2016 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.