change precision of price in magento

By default Magento show price with two decimal points like Rs. 25.00 , if you want to change the precision of  Price then
In line 62 in /lib/zend/Currency.php you can change the precision for all 
prices in your shop.
<?php
protected $_options = array(
       'position'  => self::STANDARD,  // position for the currency sign
       'script'    => null,            // script for output
       'format'    => null,            // locale for numeric output
       'display'   => self::NO_SYMBOL, // currency detail to show
       'precision' => 0,               // precision for currency
       'name'      => null,            // name for this currency
       'currency'  => null,            // 3 lettered international abbreviation
       'symbol'    => null             // currency symbol
   );
and
/app/code/core/Mage/Core/Model/Store.php
Change the roundPrice function to:
public function roundPrice($price,$roundTo=3)
   {
   return round($price, $roundTo);
   }
Mage/Directory/Model/Currency.php line 195
public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
   {
       return $this->formatPrecision($price, 3, $options, $includeContainer, $addBrackets);
   }?>

Comments

Popular posts from this blog

Sort Products by popularity count in Magento

Safe name of a file by php