From 110c9d199d44e3e7e00af277defdef9ad98c27da Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sun, 8 Mar 2020 15:22:06 +0100 Subject: [PATCH] Add 'everything' on balance format with max --- packages/types/src/codec/AbstractInt.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/types/src/codec/AbstractInt.ts b/packages/types/src/codec/AbstractInt.ts index e5adb31d05..cf0fae10b2 100644 --- a/packages/types/src/codec/AbstractInt.ts +++ b/packages/types/src/codec/AbstractInt.ts @@ -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); }