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:
@@ -43,7 +43,9 @@ $formatNumber = static function (int $value) use ($numberLocale): string {
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user