fix: correct formatCentsToCurrency usage in facebook scraper
This commit is contained in:
@@ -840,8 +840,7 @@ export function parseFacebookAds(
|
||||
title,
|
||||
listingPrice: {
|
||||
amountFormatted:
|
||||
priceObj.formatted_amount ||
|
||||
formatCentsToCurrency(cents / 100, "en-CA"),
|
||||
priceObj.formatted_amount || formatCentsToCurrency(cents, "en-CA"),
|
||||
cents,
|
||||
currency: priceObj.currency || "CAD", // Facebook marketplace often uses CAD
|
||||
},
|
||||
@@ -888,8 +887,7 @@ export function parseFacebookItem(
|
||||
if (!Number.isNaN(amount)) {
|
||||
cents = Math.round(amount * 100);
|
||||
amountFormatted =
|
||||
item.formatted_price?.text ||
|
||||
formatCentsToCurrency(cents / 100, "en-CA");
|
||||
item.formatted_price?.text || formatCentsToCurrency(cents, "en-CA");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user