Add 'everything' on balance format with max

This commit is contained in:
Jaco Greeff
2020-03-08 15:22:06 +01:00
parent b5cc8f193e
commit 110c9d199d
+3 -1
View File
@@ -156,7 +156,9 @@ export default abstract class AbstractInt extends BN implements Codec {
public toHuman (isExpanded?: boolean): any {
// FIXME we need proper expansion here
return this instanceof this.registry.createClass('Balance')
? formatBalance(this, { decimals: this.registry.chainDecimals, withSi: true, withUnit: this.registry.chainToken })
? this.isMax()
? 'everything'
: formatBalance(this, { decimals: this.registry.chainDecimals, withSi: true, withUnit: this.registry.chainToken })
: formatNumber(this);
}