mirror of
https://github.com/mempool/mempool.git
synced 2025-02-24 14:50:52 +01:00
drop decimal places from large fiat values
This commit is contained in:
parent
0c8636c803
commit
a37bcfec65
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue