mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 04:20:50 +01:00
Fix #98
This commit is contained in:
parent
a39b44899a
commit
7763dfaa82
@ -809,10 +809,12 @@ function sum($first, $second = null, $decimals = null)
|
|||||||
$bcadd = function_exists('bcadd');
|
$bcadd = function_exists('bcadd');
|
||||||
|
|
||||||
foreach ($array as $value) {
|
foreach ($array as $value) {
|
||||||
|
$value = round($value, $decimals);
|
||||||
|
|
||||||
if ($bcadd) {
|
if ($bcadd) {
|
||||||
$result = bcadd($result, $value, $decimals);
|
$result = bcadd($result, $value, $decimals);
|
||||||
} else {
|
} else {
|
||||||
$result = round($result, $decimals) + round($value, $decimals);
|
$result += $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user