format price decimal

1
34
views
Advertisement

Hello ,
If you wand to display price with/without decimal points
here is the solution

$currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();
$currency= Mage::getModel(‘directory/currency’)->load($currency_code);
echo $currency->formatPrecision(PRICE,DECIMAL NUMBERS);

if we have to diplay $480.00 as $480 simply use
echo $currency->formatPrecision(480,0);

if we have to display $480.00 as $480.0000 simply use
echo $currency->formatPrecision(480,4);

I hope this will help you….

Thanks ..
Mayank Zalavadia