summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-05-14 14:02:50 +0200
committerRaindropsSys <contact@minteck.org>2023-05-14 14:02:50 +0200
commita98bafed63f9322d54422861521c0c3c5d110d9a (patch)
treeca86cd09fd85055f8eb1ccfef10d8ed24c447145 /includes
parent926714a89d3dcc2976228b9f0039a34b1e18f5e6 (diff)
downloadpluralconnect-a98bafed63f9322d54422861521c0c3c5d110d9a.tar.gz
pluralconnect-a98bafed63f9322d54422861521c0c3c5d110d9a.tar.bz2
pluralconnect-a98bafed63f9322d54422861521c0c3c5d110d9a.zip
Updated 7 files and added 4 files (automated)
Diffstat (limited to 'includes')
-rw-r--r--includes/exchange.txt2
-rw-r--r--includes/util/functions.inc21
2 files changed, 22 insertions, 1 deletions
diff --git a/includes/exchange.txt b/includes/exchange.txt
index d04fb11..643c34f 100644
--- a/includes/exchange.txt
+++ b/includes/exchange.txt
@@ -1 +1 @@
-0.885 \ No newline at end of file
+0.871 \ No newline at end of file
diff --git a/includes/util/functions.inc b/includes/util/functions.inc
index 3d84bb7..3bc8091 100644
--- a/includes/util/functions.inc
+++ b/includes/util/functions.inc
@@ -598,4 +598,25 @@ if (!function_exists("resolveMember")) {
return $name;
}
}
+}
+
+if (!function_exists("calculateFullAmount")) {
+ function calculateFullAmount($account, $asNumber = false, $gbpOnly = false): string|float|int {
+ global $rate;
+ $total = 0;
+
+ foreach ($account["transactions"] as $transaction) {
+ $total += $transaction["amount"];
+ }
+
+ if ($asNumber) {
+ if ($gbpOnly && $account["currency"] === "eur") {
+ return $total * $rate;
+ } else {
+ return $total;
+ }
+ } else {
+ return number_format($total, 2, '.', ',');
+ }
+ }
} \ No newline at end of file