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