mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
Fix ##295 Rounding discount in buypoints
This commit is contained in:
parent
effe5d2b8e
commit
32bbecd266
@ -87,12 +87,12 @@ function calculate_discount($orig, $new) {
|
||||
if ($new != $orig) {
|
||||
$calc = ($new/$orig) - 1;
|
||||
$calc *= 100;
|
||||
$tmp = '+'. $calc .'%';
|
||||
$tmp = '+'. floor($calc) .'%';
|
||||
} else $tmp = '0%';
|
||||
} else {
|
||||
$calc = 1 - ($new/$orig);
|
||||
$calc *= 100;
|
||||
$tmp = '-'. $calc .'%';
|
||||
$tmp = '-'. floor($calc) .'%';
|
||||
}
|
||||
return $tmp;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user