Showing posts with label Remove precision from price magento. Show all posts
Showing posts with label Remove precision from price magento. Show all posts

Monday, 18 January 2016

How to remove decimal from product price in magento


How to remove decimal from product price in magento

Kindly go to app/code/core/Mage/Directory/Model/Currency.php // you can move this file in local folder too

Find the following

public function format($price, $options = array(), $includeContainer = true, $addBrackets = false)
 {
    return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
 }

And Replace it from below

public function format($price, $options = array(), $includeContainer = true, $addBrackets = false)
 {
    return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);
 }

Now go to js/varien/js.js

Find the following

var precision = isNaN(format.precision = Math.abs(format.precision)) ? 2 : format.precision;
var requiredPrecision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision;

And Replace it from below

var precision = 0;
var requiredPrecision = 0;


That's it. Enjoy Chandresh rana's Coding... :)