mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-12-22 19:55:12 +00:00
BETTERZON-42: Fixing amazon price difference percentage
This commit is contained in:
parent
31423c630a
commit
ab277b3311
|
@ -111,12 +111,8 @@ export class ProductDetailsComponent implements OnInit {
|
|||
const amazonPrice = this.currentAmazonPrice?.price_in_cents;
|
||||
const lowestPrice = this.currentlyLowestPrice?.price_in_cents;
|
||||
|
||||
const percentage = amazonPrice / lowestPrice;
|
||||
const percentage = ((amazonPrice / lowestPrice) - 1) * 100;
|
||||
|
||||
if (percentage < 1) {
|
||||
return -Math.round(percentage);
|
||||
} else {
|
||||
return +Math.round(percentage);
|
||||
}
|
||||
return Math.round(percentage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user