mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 12:25:22 +02:00
feat: Add European number formatting with dots as thousand separators
- Updated all toLocaleString() calls to use 'de-DE' locale - Applied to DataGrid, Dashboard, AdvertisingDashboard, TopMovers, geminiService - Numbers now display as €1.234 instead of €1,234 - Fixed spread operator syntax errors introduced during bulk replacement - Verified across all tabs: Dashboard, Grid, Advertising
This commit is contained in:
@@ -64,8 +64,8 @@ const WoWTooltip = ({ active, payload, label, data }: any) => {
|
||||
<div className="flex items-center">
|
||||
<span className="font-mono font-semibold text-slate-200">
|
||||
{p.dataKey === 'sellOut'
|
||||
? `€${Number(p.value).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 0 })}`
|
||||
: `${Number(p.value).toLocaleString()} u`}
|
||||
? `€${Number(p.value).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })}`
|
||||
: `${Number(p.value).toLocaleString('de-DE')} u`}
|
||||
</span>
|
||||
{wowEl}
|
||||
</div>
|
||||
@@ -151,7 +151,7 @@ const ComparisonTooltip = ({ active, payload, label }: any) => {
|
||||
<span className="font-medium" style={{ color: yearData.color }}>Sell Out:</span>
|
||||
<div className="flex items-center">
|
||||
<span className="font-mono font-semibold" style={{ color: yearData.color }}>
|
||||
€{Number(yearData.sellOut).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 0 })}
|
||||
€{Number(yearData.sellOut).toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })}
|
||||
</span>
|
||||
{sellOutGrowthEl}
|
||||
</div>
|
||||
@@ -163,7 +163,7 @@ const ComparisonTooltip = ({ active, payload, label }: any) => {
|
||||
<span className="font-medium" style={{ color: yearData.color }}>Units:</span>
|
||||
<div className="flex items-center">
|
||||
<span className="font-mono font-semibold" style={{ color: yearData.color }}>
|
||||
{Number(yearData.units).toLocaleString()} u
|
||||
{Number(yearData.units).toLocaleString('de-DE')} u
|
||||
</span>
|
||||
{unitsGrowthEl}
|
||||
</div>
|
||||
@@ -707,7 +707,7 @@ const DataGrid: React.FC<DataGridProps> = ({ data }) => {
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs text-slate-500">S.O:</span>
|
||||
<span className="text-sm font-bold text-emerald-400">
|
||||
€{yearTotals.sellOut.toLocaleString(undefined, { maximumFractionDigits: 0 })}
|
||||
€{yearTotals.sellOut.toLocaleString('de-DE', { maximumFractionDigits: 0 })}
|
||||
</span>
|
||||
{sellOutGrowth !== null && (
|
||||
<span className={`text-xs font-bold ${sellOutGrowth >= 0 ? 'text-emerald-400' : 'text-red-400'}`}>
|
||||
@@ -718,7 +718,7 @@ const DataGrid: React.FC<DataGridProps> = ({ data }) => {
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs text-slate-500">Units:</span>
|
||||
<span className="text-sm font-bold text-blue-400">
|
||||
{yearTotals.units.toLocaleString()}
|
||||
{yearTotals.units.toLocaleString('de-DE')}
|
||||
</span>
|
||||
{unitsGrowth !== null && (
|
||||
<span className={`text-xs font-bold ${unitsGrowth >= 0 ? 'text-emerald-400' : 'text-red-400'}`}>
|
||||
@@ -842,10 +842,10 @@ const DataGrid: React.FC<DataGridProps> = ({ data }) => {
|
||||
return (
|
||||
<React.Fragment key={year}>
|
||||
<td className="px-4 py-3 text-right font-medium text-white group-hover:text-emerald-400 transition-colors">
|
||||
{data ? `€${data.sellOut.toLocaleString(undefined, { maximumFractionDigits: 0 })}` : '-'}
|
||||
{data ? `€${data.sellOut.toLocaleString('de-DE', { maximumFractionDigits: 0 })}` : '-'}
|
||||
</td>
|
||||
<td className="px-4 py-3 text-right text-slate-400">
|
||||
{data ? data.units.toLocaleString() : '-'}
|
||||
{data ? data.units.toLocaleString('de-DE') : '-'}
|
||||
</td>
|
||||
|
||||
{/* Growth Cells */}
|
||||
|
||||
Reference in New Issue
Block a user