mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-10-27 12:57:35 +00:00
BETTERZON-42: Fixing amazon price difference percentage
This commit is contained in:
1 parent
31423c630a
commit
ab277b3311
1 file changed
+2
-6
@@ -111,12 +111,8 @@ export class ProductDetailsComponent implements OnInit {
|
|||||||
const amazonPrice = this.currentAmazonPrice?.price_in_cents;
|
const amazonPrice = this.currentAmazonPrice?.price_in_cents;
|
||||||
const lowestPrice = this.currentlyLowestPrice?.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);
|
||||||
return -Math.round(percentage);
|
|
||||||
} else {
|
|
||||||
return +Math.round(percentage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user