diff --git a/code/admin/PriceField.php b/code/admin/PriceField.php index ffdaedd8..1bf7d189 100644 --- a/code/admin/PriceField.php +++ b/code/admin/PriceField.php @@ -33,16 +33,12 @@ public function FieldHolder($properties = array()) { public function setValue($val) { if(!$val) $val = 0.00; $shopConfig = ShopConfig::current_shop_config(); - $precision = 2; //precision should always be two decimals, and only more if specified in ShopConfig - if($shopConfig && $shopConfig->BaseCurrencyPrecision > 2) { - $precision = $shopConfig->BaseCurrencyPrecision; - } + $precision = $shopConfig->BaseCurrencyPrecision; $this->value = number_format((double)preg_replace('/[^0-9.\-]/', '', $val), $precision); return $this; } - public function validate($validator) { if(!empty ($this->value) //validate against any number of digits after the decimal place diff --git a/code/form/OrderForm.php b/code/form/OrderForm.php index cfe402ab..c71927c1 100644 --- a/code/form/OrderForm.php +++ b/code/form/OrderForm.php @@ -316,10 +316,7 @@ public function process($data, $form) { try { $shopConfig = ShopConfig::current_shop_config(); - $precision = 2; //precision should always be two decimals, and only more if specified in ShopConfig - if($shopConfig && $shopConfig->BaseCurrencyPrecision > 2) { - $precision = $shopConfig->BaseCurrencyPrecision; - } + $precision = $shopConfig->BaseCurrencyPrecision; $paymentData = array( 'Amount' => number_format($order->Total()->getAmount(), $precision, '.', ''),