Remove decimals from Dashboard and fix BuyBox badge layout

This commit is contained in:
christian.vidal
2026-01-29 20:19:13 +01:00
parent 0211124879
commit 55c91a7bfc
2 changed files with 9 additions and 7 deletions
+6 -4
View File
@@ -91,7 +91,9 @@ const MultiYearKPICard: React.FC<{
const formatValue = (val: number) => {
if (metric === 'sellOut') {
return `${val.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
if (metric === 'sellOut') {
return `${val.toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })}`;
}
}
return val.toLocaleString('de-DE');
};
@@ -166,7 +168,7 @@ const MultiYearKPICard: React.FC<{
{contextGrowthElement}
{/* Share of Line % */}
<span className="text-indigo-400 font-bold border-l border-slate-700 pl-2 ml-2 whitespace-nowrap">
{((currentValue / contextValue) * 100).toFixed(1)}% Share
{((currentValue / contextValue) * 100).toFixed(0)}% Share
</span>
</div>
</div>
@@ -424,7 +426,7 @@ const GrowthTable: React.FC<{
</td>
<td className="px-4 py-2 text-right">
<span className={`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${item.sellOutGrowthPercentage >= 0 ? 'bg-emerald-500/10 text-emerald-400' : 'bg-red-500/10 text-red-400'}`}>
{item.sellOutGrowthPercentage.toFixed(1)}%
{item.sellOutGrowthPercentage.toFixed(0)}%
</span>
</td>
@@ -436,7 +438,7 @@ const GrowthTable: React.FC<{
</td>
<td className="px-4 py-2 text-right">
<span className={`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${item.unitsGrowthPercentage >= 0 ? 'bg-violet-500/10 text-violet-400' : 'bg-orange-500/10 text-orange-400'}`}>
{item.unitsGrowthPercentage.toFixed(1)}%
{item.unitsGrowthPercentage.toFixed(0)}%
</span>
</td>
</tr>