Browse Source

Bugfix/Add useGrouping option for locale string formatting

pull/8053/head
Antonio D. González 1 week ago
parent
commit
18ddfbbc92
  1. 1
      CHANGELOG.md
  2. 3
      apps/client/src/app/components/admin-overview/admin-overview.component.ts
  3. 6
      libs/ui/src/lib/fire-calculator/fire-calculator.component.ts
  4. 8
      libs/ui/src/lib/treemap-chart/treemap-chart.component.ts

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Upgraded `Nx` from version `23.1.1` to `23.2.1`
- Fixed the missing thousands separator of 4-digit numbers in certain locales
## 3.79.0 - 2026-10-04

3
apps/client/src/app/components/admin-overview/admin-overview.component.ts

@ -170,7 +170,8 @@ export class GfAdminOverviewComponent implements OnInit {
this.activitiesCount / this.userCount
).toLocaleString(this.user?.settings?.locale, {
maximumFractionDigits: 2,
minimumFractionDigits: 2
minimumFractionDigits: 2,
useGrouping: true
});
return `(${formattedActivitiesCountPerUser} ${$localize`per User`})`;

6
libs/ui/src/lib/fire-calculator/fire-calculator.component.ts

@ -358,7 +358,8 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy {
return `Total: ${new Intl.NumberFormat(this.locale, {
currency: this.currency ?? DEFAULT_CURRENCY,
currencyDisplay: 'code',
style: 'currency'
style: 'currency',
useGrouping: true
}).format(totalAmount)}`;
},
label: (context) => {
@ -372,7 +373,8 @@ export class GfFireCalculatorComponent implements OnChanges, OnDestroy {
label += new Intl.NumberFormat(this.locale, {
currency: this.currency ?? DEFAULT_CURRENCY,
currencyDisplay: 'code',
style: 'currency'
style: 'currency',
useGrouping: true
}).format(context.parsed.y);
}

8
libs/ui/src/lib/treemap-chart/treemap-chart.component.ts

@ -324,8 +324,8 @@ export class GfTreemapChartComponent
).toLocaleString(this.locale(), {
maximumFractionDigits: 2,
minimumFractionDigits: 2,
useGrouping: true,
signDisplay: 'exceptZero'
signDisplay: 'exceptZero',
useGrouping: true
})}%`
];
},
@ -412,8 +412,8 @@ export class GfTreemapChartComponent
).toLocaleString(this.locale(), {
maximumFractionDigits: 2,
minimumFractionDigits: 2,
useGrouping: true,
signDisplay: 'exceptZero'
signDisplay: 'exceptZero',
useGrouping: true
})}%`;
if (raw._data.valueInBaseCurrency !== null) {

Loading…
Cancel
Save