diff --git a/CHANGELOG.md b/CHANGELOG.md index f9bbcca84..e94d88d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Localized the number formatting of the y-axis labels in the line chart component - Improved the wording of the 4% rule in the _FIRE_ section - Improved the language localization for German (`de`) diff --git a/libs/ui/src/lib/line-chart/line-chart.component.ts b/libs/ui/src/lib/line-chart/line-chart.component.ts index e7f8b132e..0afef5959 100644 --- a/libs/ui/src/lib/line-chart/line-chart.component.ts +++ b/libs/ui/src/lib/line-chart/line-chart.component.ts @@ -261,7 +261,10 @@ export class GfLineChartComponent } if (typeof tickValue === 'number') { - return tickValue.toFixed(2); + return tickValue.toLocaleString(this.locale, { + maximumFractionDigits: 2, + minimumFractionDigits: 2 + }); } return tickValue;