Refactor number formatting in landing page for improved localization support

- Updated the number formatting logic in index.php to enhance localization handling for German and English.
- Introduced variables for decimal and thousands separators based on the user's locale, ensuring accurate number representation.
This commit is contained in:
TheOnlyMace
2026-07-22 19:19:43 +02:00
parent bda5c116fe
commit f1d74f922d

View File

@@ -43,7 +43,9 @@ $formatNumber = static function (int $value) use ($numberLocale): string {
return $formatted; return $formatted;
} }
} }
return number_format($value, 0, $locale === 'de' ? ',' : '.', $locale === 'de' ? '.' : ','); $decimal = $numberLocale === 'de_DE' ? ',' : '.';
$thousands = $numberLocale === 'de_DE' ? '.' : ',';
return number_format($value, 0, $decimal, $thousands);
}; };
/** @var array<string, array{label: string, modules: list<array{label: string, description: string}>}> $groups */ /** @var array<string, array{label: string, modules: list<array{label: string, description: string}>}> $groups */