aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-17 07:13:23 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-17 07:13:23 +0800
commit2610868589a9de0a9067047e69dcd252b2b5f985 (patch)
tree06674c67253ead45e0274bc339bec9372c66bea2 /packages/instant/src/util
parentdbf5be6c217b49c4b768a9ea9969d44d70fb3dcc (diff)
downloaddexon-sol-tools-2610868589a9de0a9067047e69dcd252b2b5f985.tar.gz
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/util')
-rw-r--r--packages/instant/src/util/format.ts2
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)}`;
},
};