-
- bulik1983

-
Total Posts: 9
Joined: 2012-12-06
|
Hi I am trynig to change this code:
public static function trimZeroRight($price, $precision) { if (!Mage::getStoreConfig('price_decimal/general/trim_zero_right')) return $precision; $xPrice = sprintf("%." . $precision . "F", $price); $decimal = strrchr($xPrice, '.'); $c1 = strlen($decimal); $decimal = rtrim($decimal, '0'); $c2 = strlen($decimal); $xPrecision = $precision - ($c1 - $c2); return $xPrecision; }
to trim only one zero from right not 2 or more because this code trim all zero from right
So for exmple if something cost £1.200 (one pound twenty) it trim to £1.20 not to £1.2 like in this code
please help
|