Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: Price, formatted but without currency symbol

Tags:

magento

I want to get a formatted price but without the currency symbol and I want use only standard functionality of magento!

$product->getFinalPrice(); => 19.9900

Mage::helper('core')->formatPrice($product->getFinalPrice(), false); => 19,99 €

Mage::helper('mymodul')->foobar($product->getFinalPrice()); => 19,99

How is that possible? (I don't want use str_replace()...)

like image 875
timopeschka Avatar asked Sep 01 '11 12:09

timopeschka


People also ask

How do I get the currency symbol in Magento 2?

You can use following code: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $currencysymbol = $objectManager->get('Magento\Directory\Model\Currency'); echo $currencysymbol->getCurrencySymbol();


1 Answers

Mage::getModel('directory/currency')->format(
    $product->getFinalPrice(), 
    array('display'=>Zend_Currency::NO_SYMBOL), 
    false
);
like image 180
Юрий Николаев Avatar answered Oct 18 '22 03:10

Юрий Николаев