From a37bcfec651350aca47dc21921440186dbe7818f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 4 Mar 2023 00:10:47 -0600 Subject: [PATCH] drop decimal places from large fiat values --- frontend/src/app/shared/pipes/fiat-currency.pipe.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/shared/pipes/fiat-currency.pipe.ts b/frontend/src/app/shared/pipes/fiat-currency.pipe.ts index 3cd825291..2ae796d2b 100644 --- a/frontend/src/app/shared/pipes/fiat-currency.pipe.ts +++ b/frontend/src/app/shared/pipes/fiat-currency.pipe.ts @@ -23,6 +23,10 @@ export class FiatCurrencyPipe implements PipeTransform { const digits = args[0] || 1; const currency = args[1] || this.currency || 'USD'; - return new Intl.NumberFormat(this.locale, { style: 'currency', currency }).format(num); + if (num >= 1000) { + return new Intl.NumberFormat(this.locale, { style: 'currency', currency, maximumFractionDigits: 0 }).format(num); + } else { + return new Intl.NumberFormat(this.locale, { style: 'currency', currency }).format(num); + } } } \ No newline at end of file