Align comm percentage display (#2402)
This commit is contained in:
parent
f4867ee7f3
commit
b21008af1a
@ -56,7 +56,7 @@ function expandInfo ({ controllerId, exposure, nextSessionIds, validatorPrefs }:
|
||||
|
||||
return {
|
||||
commission: commission
|
||||
? `${(commission.toNumber() / 10000000).toFixed(2)}%`
|
||||
? `${(commission.toNumber() / 10_000_000).toFixed(2)}%`
|
||||
: undefined,
|
||||
controllerId: controllerId?.toString(),
|
||||
nominators,
|
||||
|
||||
@ -135,7 +135,7 @@ function extractInfo (allAccounts: string[], amount: BN = new BN(0), electedInfo
|
||||
isFavorite: favorites.includes(key),
|
||||
isNominating,
|
||||
key,
|
||||
commissionPer: (((prefs as ValidatorPrefs).commission?.unwrap() || new BN(0)).muln(10000).div(PERBILL).toNumber() / 100),
|
||||
commissionPer: (((prefs as ValidatorPrefs).commission?.unwrap() || new BN(0)).toNumber() / 10_000_000),
|
||||
numNominators: exposure.others.length,
|
||||
rankBondOther: 0,
|
||||
rankBondOwn: 0,
|
||||
|
||||
@ -42,8 +42,6 @@ export interface ValidatorPrefsType {
|
||||
validatorPayment?: boolean;
|
||||
}
|
||||
|
||||
const PERBILL = new BN(1000000000);
|
||||
|
||||
interface Props extends BareProps {
|
||||
address: string;
|
||||
balancesAll?: DerivedBalancesAll;
|
||||
@ -229,7 +227,7 @@ function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Prop
|
||||
: (
|
||||
<>
|
||||
<Label label={t('commission')} />
|
||||
<span>{(stakingInfo.validatorPrefs.commission.unwrap().muln(10000).div(PERBILL).toNumber() / 100).toFixed(2)}%</span>
|
||||
<span>{(stakingInfo.validatorPrefs.commission.unwrap().toNumber() / 10_000_000).toFixed(2)}%</span>
|
||||
</>
|
||||
)
|
||||
)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user