lets try to get around some rounding issue for balance and transactions
This commit is contained in:
parent
0f379d8b11
commit
a120d41612
@ -62,6 +62,8 @@ if (! empty($users)) {
|
||||
} else {
|
||||
verbose("FAILED\n");
|
||||
}
|
||||
} else {
|
||||
verbose("SKIPPED\n");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -65,7 +65,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
||||
$aData['payout'] = number_format(round(( $aData['percentage'] / 100 ) * $config['reward'], 8), 8);
|
||||
|
||||
// Calculate donation amount for Donation transaction
|
||||
$aData['donation'] = $user->getDonatePercent($user->getUserId($aData['username'])) / 100 * $aData['payout'];
|
||||
$aData['donation'] = number_format(round($user->getDonatePercent($user->getUserId($aData['username'])) / 100 * $aData['payout'], 8), 8);
|
||||
|
||||
// Verbose output of this users calculations
|
||||
verbose($aData['id'] . "\t" .
|
||||
|
||||
@ -76,7 +76,7 @@ class Transaction {
|
||||
|
||||
public function getBalance($account_id) {
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT IFNULL(t1.credit, 0) - IFNULL(t2.debit, 0) - IFNULL(t3.other, 0) AS balance
|
||||
SELECT ROUND(IFNULL(t1.credit, 0) - IFNULL(t2.debit, 0) - IFNULL(t3.other, 0), 8) AS balance
|
||||
FROM
|
||||
(
|
||||
SELECT sum(t.amount) AS credit
|
||||
|
||||
Loading…
Reference in New Issue
Block a user