Magento:价格,格式但没有货币符号

时间:2011-09-01 12:49:36

标签: magento

我想获得格式化的价格,但没有货币符号,我只想使用magento的标准功能!

$product->getFinalPrice(); => 19.9900

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

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

怎么可能? (我不想使用str_replace()...)

4 个答案:

答案 0 :(得分:20)

Mage::getModel('directory/currency')->format(
    $product->getFinalPrice(), 
    array('display'=>Zend_Currency::NO_SYMBOL), 
    false
);

答案 1 :(得分:6)

只需要一行代码即可。试试这个

Mage::helper('core')->currency($_yourPriceToFormat, false, false);

答案 2 :(得分:3)

您可以使用directory/currency型号:

Mage::getModel('directory/currency')->formatTxt(
    $product->getFinalPrice(),
    array('display' => Zend_Currency::NO_SYMBOL)
);

答案 3 :(得分:1)

Mage::helper('core')->currency($product->getFinalPrice(), false, false);
相关问题