summaryrefslogtreecommitdiff
path: root/pages/api/money
diff options
context:
space:
mode:
Diffstat (limited to 'pages/api/money')
-rw-r--r--pages/api/money/account.php2
-rw-r--r--pages/api/money/accounts.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/pages/api/money/account.php b/pages/api/money/account.php
index 6620733..1801b28 100644
--- a/pages/api/money/account.php
+++ b/pages/api/money/account.php
@@ -29,7 +29,7 @@ foreach ($accounts as $account) {
$acc["total"] = round(calculateFullAmount($account, true), 2);
$acc["interests"] = $account["interests"];
$acc["max"] = $account["max"];
- $acc["used_percentage"] = isset($account["max"]) ? (calculateFullAmount($account, true) / $account["max"]) * 100 : null;
+ $acc["used_percentage"] = isset($account["max"]) ? round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) : null;
$acc["transactions"] = [];
foreach ($account["transactions"] as $index => $transaction) {
diff --git a/pages/api/money/accounts.php b/pages/api/money/accounts.php
index 22d8c77..9f85323 100644
--- a/pages/api/money/accounts.php
+++ b/pages/api/money/accounts.php
@@ -58,7 +58,7 @@ foreach ($accounts as $index => $account) {
$acc["total"] = round(calculateFullAmount($account, true), 2);
$acc["interests"] = $account["interests"];
$acc["max"] = $account["max"];
- $acc["used_percentage"] = isset($account["max"]) ? (calculateFullAmount($account, true) / $account["max"]) * 100 : null;
+ $acc["used_percentage"] = isset($account["max"]) ? round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) : null;
$obj["users"]["cloudburst"]["accounts"][] = $acc;
}
@@ -84,7 +84,7 @@ foreach ($accounts as $index => $account) {
$acc["total"] = round(calculateFullAmount($account, true), 2);
$acc["interests"] = $account["interests"];
$acc["max"] = $account["max"];
- $acc["used_percentage"] = isset($account["max"]) ? (calculateFullAmount($account, true) / $account["max"]) * 100 : null;
+ $acc["used_percentage"] = isset($account["max"]) ? round((calculateFullAmount($account, true) / $account["max"]) * 100, 2) : null;
$acc["transactions"] = null;
$obj["users"]["raindrops"]["accounts"][] = $acc;