diff options
Diffstat (limited to 'packages/instant/src/util/asset.ts')
-rw-r--r-- | packages/instant/src/util/asset.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index 709561dbc..b5c97913d 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -114,15 +114,18 @@ export const assetUtils = { const assetName = assetUtils.bestNameForAsset(asset, 'of this asset'); if ( error instanceof InsufficientAssetLiquidityError && - error.amountAvailableToFill.greaterThan(BIG_NUMBER_ZERO) + error.amountAvailableToFill.isGreaterThan(BIG_NUMBER_ZERO) ) { const unitAmountAvailableToFill = Web3Wrapper.toUnitAmount( error.amountAvailableToFill, asset.metaData.decimals, ); - const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.round(2, BigNumber.ROUND_DOWN); + const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.decimalPlaces( + 2, + BigNumber.ROUND_DOWN, + ); - if (roundedUnitAmountAvailableToFill.greaterThan(BIG_NUMBER_ZERO)) { + if (roundedUnitAmountAvailableToFill.isGreaterThan(BIG_NUMBER_ZERO)) { return `There are only ${roundedUnitAmountAvailableToFill} ${assetName} available to buy`; } } |