Browse Source

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
pull/5633/head^2
David Requeno 3 weeks ago
committed by GitHub
parent
commit
da80efa0c6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 5
      libs/ui/src/lib/line-chart/line-chart.component.ts

1
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`)

5
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;

Loading…
Cancel
Save