Skip to content

Commit

Permalink
Merge pull request #182 from greymass/dev
Browse files Browse the repository at this point in the history
fix: fixed balance formatting in dropdown (#181)
  • Loading branch information
aaroncox authored Mar 7, 2024
2 parents ce67e27 + 651a3a5 commit b08177d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/components/elements/input/token/selector/row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@
}
function formatBalanceString(balanceString: string) {
if (balanceString.length < 9) {
return balanceString
}
const balanceInIntegers = balanceString.split('.')[0]
const decimals = balanceString.split('.')[1]
if (balanceInIntegers.length < 8) {
return balanceInIntegers
return decimals?.length === 0
? balanceString
: `${balanceInIntegers}.${decimals.substring(0, 4)}`
}
return `${Number(balanceInIntegers) / 1000000} M`
Expand Down
6 changes: 5 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ export const chains: ChainConfig[] = [
},
{
id: 'proton',
chainFeatures: new Set([ChainFeatures.Staking, ChainFeatures.VoteProducer]),
chainFeatures: new Set([
ChainFeatures.BuyRAM,
ChainFeatures.Staking,
ChainFeatures.VoteProducer,
]),
chainId: ChainId.from('384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0'),
coreTokenSymbol: Asset.Symbol.from('4,XPR'),
coreTokenContract: Name.from('eosio.token'),
Expand Down

0 comments on commit b08177d

Please sign in to comment.