From e558edb79586fee9e079ee9944ad1d05d43d32e6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Feb 2022 18:07:05 +1100 Subject: [PATCH] Reversion for unit cost precision --- app/Utils/Number.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Utils/Number.php b/app/Utils/Number.php index 40d1401a1086..f3105ce77958 100644 --- a/app/Utils/Number.php +++ b/app/Utils/Number.php @@ -200,13 +200,13 @@ class Number /* 08-01-2022 allow increased precision for unit price*/ $v = rtrim(sprintf('%f', $value),"0"); - $precision = strlen(substr(strrchr($v, $decimal), 1)); + // $precision = strlen(substr(strrchr($v, $decimal), 1)); - // if($v<1) - // $precision = strlen($v) - strrpos($v, '.') - 1; + if($v<1) + $precision = strlen($v) - strrpos($v, '.') - 1; - if($precision == 1) - $precision = 2; + // if($precision == 1) + // $precision = 2; $value = number_format($v, $precision, $decimal, $thousand); $symbol = $currency->symbol;