From da80efa0c620f73b37e96c1e34b421a60aecfdca Mon Sep 17 00:00:00 2001 From: David Requeno <108202767+DavidReque@users.noreply.github.com> Date: Tue, 30 Sep 2025 12:17:09 -0600 Subject: [PATCH] Task/localize number formatting of y-axis labels in line chart component (#5624) * Localize number formatting of y-axis labels in line chart component * Update changelog --- CHANGELOG.md | 1 + libs/ui/src/lib/line-chart/line-chart.component.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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;