diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-17 07:13:23 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-17 07:13:23 +0800 |
commit | 2610868589a9de0a9067047e69dcd252b2b5f985 (patch) | |
tree | 06674c67253ead45e0274bc339bec9372c66bea2 /packages/instant/src | |
parent | dbf5be6c217b49c4b768a9ea9969d44d70fb3dcc (diff) | |
download | dexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.tar dexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.tar.gz dexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.tar.bz2 dexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.tar.lz dexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.tar.xz dexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.tar.zst dexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.zip |
Add tests for format and use toFixed instead of round for usd
Diffstat (limited to 'packages/instant/src')
-rw-r--r-- | packages/instant/src/util/format.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/instant/src/util/format.ts b/packages/instant/src/util/format.ts index de7eb62e6..b62c968fb 100644 --- a/packages/instant/src/util/format.ts +++ b/packages/instant/src/util/format.ts @@ -40,6 +40,6 @@ export const format = { if (_.isUndefined(ethUnitAmount) || _.isUndefined(ethUsdPrice)) { return defaultText; } - return `$${ethUnitAmount.mul(ethUsdPrice).round(decimalPlaces)}`; + return `$${ethUnitAmount.mul(ethUsdPrice).toFixed(decimalPlaces)}`; }, }; |