aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-07-07 05:09:36 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-07-07 05:21:30 +0800
commit9669a4d1216b7d22107580daf3e2bff464eb2ade (patch)
treee408ae8281b8fc09ac253b7547027639e5f2943c /packages/website/ts/utils
parent7418926ebb156165f328a89cf58ec758737ee999 (diff)
downloaddexon-sol-tools-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar
dexon-sol-tools-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.gz
dexon-sol-tools-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.bz2
dexon-sol-tools-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.lz
dexon-sol-tools-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.xz
dexon-sol-tools-9669a4d1216b7d22107580daf3e2bff464eb2ade.tar.zst
dexon-sol-tools-9669a4d1216b7d22107580daf3e2bff464eb2ade.zip
Create Balance component and make token symbols smaller than token amounts
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/utils.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index 623819fc9..6ab642f53 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -381,9 +381,9 @@ export const utils = {
return trackedTokens;
},
getFormattedAmountFromToken(token: Token, tokenState: TokenState): string {
- return utils.getFormattedAmount(tokenState.balance, token.decimals, token.symbol);
+ return utils.getFormattedAmount(tokenState.balance, token.decimals);
},
- getFormattedAmount(amount: BigNumber, decimals: number, symbol: string): string {
+ getFormattedAmount(amount: BigNumber, decimals: number): string {
const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals);
// if the unit amount is less than 1, show the natural number of decimal places with a max of 4
// if the unit amount is greater than or equal to 1, show only 2 decimal places
@@ -392,7 +392,7 @@ export const utils = {
: 2;
const format = `0,0.${_.repeat('0', precision)}`;
const formattedAmount = numeral(unitAmount).format(format);
- return `${formattedAmount} ${symbol}`;
+ return formattedAmount;
},
getUsdValueFormattedAmount(amount: BigNumber, decimals: number, price: BigNumber): string {
const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals);