From 8987481a3e6ca39573e382335493d0152b283605 Mon Sep 17 00:00:00 2001 From: Juanma Hidalgo Date: Thu, 7 Dec 2023 17:47:48 +0100 Subject: [PATCH] feat: set maximum fraction digits when formatting numbers (#2071) --- webapp/src/components/AssetCard/utils.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/AssetCard/utils.tsx b/webapp/src/components/AssetCard/utils.tsx index c0e922fe28..c78d918393 100644 --- a/webapp/src/components/AssetCard/utils.tsx +++ b/webapp/src/components/AssetCard/utils.tsx @@ -7,7 +7,10 @@ import { getMinimumValueForFractionDigits } from '../../lib/mana' import { BrowseOptions, SortBy } from '../../modules/routing/types' import { Mana } from '../Mana' -const formatter = Intl.NumberFormat('en', { notation: 'compact' }) +const formatter = Intl.NumberFormat('en', { + notation: 'compact', + maximumFractionDigits: 2 +}) export function formatWeiToAssetCard(wei: string): string { const maximumFractionDigits = MAXIMUM_FRACTION_DIGITS