Browse Source

Bugfix/missing thousands separator in ES (#8053)

* Fix missing thousands separator

* Update changelog
pull/8057/head^2
Antonio David González 3 days ago
committed by GitHub
parent
commit
71ac4126f0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 3
      apps/api/src/models/rules/emergency-fund/emergency-fund-coverage.ts
  3. 6
      apps/api/src/models/rules/liquidity/buying-power.ts
  4. 3
      apps/client/src/app/components/admin-overview/admin-overview.component.ts
  5. 3
      libs/common/src/lib/chart-helper.ts
  6. 6
      libs/ui/src/lib/fire-calculator/fire-calculator.component.ts
  7. 3
      libs/ui/src/lib/line-chart/line-chart.component.ts
  8. 3
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts
  9. 15
      libs/ui/src/lib/treemap-chart/treemap-chart.component.ts
  10. 7
      libs/ui/src/lib/value/value.component.ts

1
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed the missing thousands separator of 4-digit numbers in certain locales
- Fixed an issue where holdings without a market price have been valued at the unit price of a dividend, a fee, an interest or a liability - Fixed an issue where holdings without a market price have been valued at the unit price of a dividend, a fee, an interest or a liability
## 3.79.0 - 2026-10-04 ## 3.79.0 - 2026-10-04

3
apps/api/src/models/rules/emergency-fund/emergency-fund-coverage.ts

@ -53,7 +53,8 @@ export class EmergencyFundCoverage extends Rule<Settings> {
const placeholders = { const placeholders = {
baseCurrency: ruleSettings.baseCurrency, baseCurrency: ruleSettings.baseCurrency,
emergencyFund: this.emergencyFundInBaseCurrency.toLocaleString( emergencyFund: this.emergencyFundInBaseCurrency.toLocaleString(
ruleSettings.locale ruleSettings.locale,
{ useGrouping: true }
) )
}; };

6
apps/api/src/models/rules/liquidity/buying-power.ts

@ -44,7 +44,8 @@ export class BuyingPower extends Rule<Settings> {
placeholders: { placeholders: {
baseCurrency: ruleSettings.baseCurrency, baseCurrency: ruleSettings.baseCurrency,
thresholdMin: ruleSettings.thresholdMin.toLocaleString( thresholdMin: ruleSettings.thresholdMin.toLocaleString(
ruleSettings.locale ruleSettings.locale,
{ useGrouping: true }
) )
} }
}), }),
@ -59,7 +60,8 @@ export class BuyingPower extends Rule<Settings> {
placeholders: { placeholders: {
baseCurrency: ruleSettings.baseCurrency, baseCurrency: ruleSettings.baseCurrency,
thresholdMin: ruleSettings.thresholdMin.toLocaleString( thresholdMin: ruleSettings.thresholdMin.toLocaleString(
ruleSettings.locale ruleSettings.locale,
{ useGrouping: true }
) )
} }
}), }),

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 this.activitiesCount / this.userCount
).toLocaleString(this.user?.settings?.locale, { ).toLocaleString(this.user?.settings?.locale, {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2 minimumFractionDigits: 2,
useGrouping: true
}); });
return `(${formattedActivitiesCountPerUser} ${$localize`per User`})`; return `(${formattedActivitiesCountPerUser} ${$localize`per User`})`;

3
libs/common/src/lib/chart-helper.ts

@ -123,7 +123,8 @@ export function getTooltipOptions<T extends ChartType>({
if (currency) { if (currency) {
label += `${yPoint.toLocaleString(locale, { label += `${yPoint.toLocaleString(locale, {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2 minimumFractionDigits: 2,
useGrouping: true
})} ${currency}`; })} ${currency}`;
} else if (unit) { } else if (unit) {
label += `${yPoint.toFixed(2)} ${unit}`; label += `${yPoint.toFixed(2)} ${unit}`;

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

3
libs/ui/src/lib/line-chart/line-chart.component.ts

@ -258,7 +258,8 @@ export class GfLineChartComponent
if (typeof tickValue === 'number') { if (typeof tickValue === 'number') {
return tickValue.toLocaleString(this.locale, { return tickValue.toLocaleString(this.locale, {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2 minimumFractionDigits: 2,
useGrouping: true
}); });
} }

3
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

@ -496,7 +496,8 @@ export class GfPortfolioProportionChartComponent
`${name ?? symbol}`, `${name ?? symbol}`,
`${value.toLocaleString(this.locale, { `${value.toLocaleString(this.locale, {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2 minimumFractionDigits: 2,
useGrouping: true
})} ${this.baseCurrency ?? ''} (${percentage.toFixed(2)}%)` })} ${this.baseCurrency ?? ''} (${percentage.toFixed(2)}%)`
]; ];
} }

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

@ -324,7 +324,8 @@ export class GfTreemapChartComponent
).toLocaleString(this.locale(), { ).toLocaleString(this.locale(), {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2, minimumFractionDigits: 2,
signDisplay: 'exceptZero' signDisplay: 'exceptZero',
useGrouping: true
})}%` })}%`
]; ];
}, },
@ -401,7 +402,8 @@ export class GfTreemapChartComponent
raw._data.allocationInPercentage * 100 raw._data.allocationInPercentage * 100
).toLocaleString(this.locale(), { ).toLocaleString(this.locale(), {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2 minimumFractionDigits: 2,
useGrouping: true
})}%`; })}%`;
const name = getHoldingName(raw._data.assetProfile); const name = getHoldingName(raw._data.assetProfile);
@ -410,7 +412,8 @@ export class GfTreemapChartComponent
).toLocaleString(this.locale(), { ).toLocaleString(this.locale(), {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2, minimumFractionDigits: 2,
signDisplay: 'exceptZero' signDisplay: 'exceptZero',
useGrouping: true
})}%`; })}%`;
if (raw._data.valueInBaseCurrency !== null) { if (raw._data.valueInBaseCurrency !== null) {
@ -420,7 +423,8 @@ export class GfTreemapChartComponent
`${name} (${allocationInPercentage})`, `${name} (${allocationInPercentage})`,
`${value?.toLocaleString(this.locale(), { `${value?.toLocaleString(this.locale(), {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2 minimumFractionDigits: 2,
useGrouping: true
})} ${this.baseCurrency()}`, })} ${this.baseCurrency()}`,
'', '',
$localize`Change` + ' (' + $localize`Performance` + ')', $localize`Change` + ' (' + $localize`Performance` + ')',
@ -429,7 +433,8 @@ export class GfTreemapChartComponent
{ {
maximumFractionDigits: 2, maximumFractionDigits: 2,
minimumFractionDigits: 2, minimumFractionDigits: 2,
signDisplay: 'exceptZero' signDisplay: 'exceptZero',
useGrouping: true
} }
)} ${this.baseCurrency()} (${netPerformanceInPercentageWithSign})` )} ${this.baseCurrency()} (${netPerformanceInPercentageWithSign})`
]; ];

7
libs/ui/src/lib/value/value.component.ts

@ -83,7 +83,8 @@ export class GfValueComponent implements AfterViewInit, OnChanges, OnDestroy {
return { return {
maximumFractionDigits: digits, maximumFractionDigits: digits,
minimumFractionDigits: digits minimumFractionDigits: digits,
useGrouping: true
}; };
}); });
@ -150,7 +151,9 @@ export class GfValueComponent implements AfterViewInit, OnChanges, OnDestroy {
); );
} catch {} } catch {}
} else { } else {
this.formattedValue = this.value?.toLocaleString(this.locale); this.formattedValue = this.value?.toLocaleString(this.locale, {
useGrouping: true
});
} }
if (this.isAbsolute) { if (this.isAbsolute) {

Loading…
Cancel
Save