mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-05-15 10:52:36 +02:00
Add Swiss franc (CHF) and improve Euro currency support
- Add CHF to currency detection patterns in priceParser - Add getCurrencySymbol helper in notifications service - Update all frontend price formatting to support CHF - Swiss francs display as "CHF 29.99" format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c2cec6d4f1
commit
4928d6b9d3
5 changed files with 25 additions and 9 deletions
|
|
@ -59,7 +59,7 @@ export default function PriceChart({
|
|||
};
|
||||
|
||||
const currencySymbol =
|
||||
currency === 'EUR' ? '€' : currency === 'GBP' ? '£' : '$';
|
||||
currency === 'EUR' ? '€' : currency === 'GBP' ? '£' : currency === 'CHF' ? 'CHF ' : '$';
|
||||
|
||||
const chartData = prices.map((p) => ({
|
||||
date: new Date(p.recorded_at).getTime(),
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export default function ProductCard({ product, onDelete, onRefresh, isSelected,
|
|||
const numPrice = typeof price === 'string' ? parseFloat(price) : price;
|
||||
if (isNaN(numPrice)) return 'N/A';
|
||||
const currencySymbol =
|
||||
currency === 'EUR' ? '€' : currency === 'GBP' ? '£' : '$';
|
||||
currency === 'EUR' ? '€' : currency === 'GBP' ? '£' : currency === 'CHF' ? 'CHF ' : '$';
|
||||
return `${currencySymbol}${numPrice.toFixed(2)}`;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue