Fix format balance issue (#10908)

This commit is contained in:
Tarik Gul 2024-09-10 07:06:16 -07:00 committed by GitHub
parent 44b068327f
commit 3f002dfcb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,7 @@ function splitFormat (value: string, label?: LabelPost, isShort?: boolean): Reac
}
function applyFormat (value: Compact<any> | BN | string | number, [decimals, token]: [number, string], withCurrency = true, withSi?: boolean, _isShort?: boolean, labelPost?: LabelPost, useTicker?: boolean): React.ReactNode {
const [prefix, postfix, ticker] = formatBalance(value, { decimals }).split(/[.\s]+/);
const [prefix, postfix, ticker] = formatBalance(value, { decimals, forceUnit: '-', withSi: false }).split('.');
const isShort = _isShort || (withSi && prefix.length >= K_LENGTH);
const unitPost = withCurrency ? token : '';