FIX: better balance string formatting

This commit is contained in:
Overtorment 2018-07-06 16:42:37 +01:00
parent f6c35271cc
commit bce7dace88
2 changed files with 8 additions and 1 deletions

View File

@ -806,7 +806,7 @@ export class WalletsCarousel extends Component {
color: '#fff',
}}
>
{item.getBalance()} BTC
{loc.formatBalance(item.getBalance())}
</Text>
<Text style={{ backgroundColor: 'transparent' }} />
<Text

View File

@ -63,4 +63,11 @@ strings.transactionTimeToReadable = function(time) {
}
};
strings.formatBalance = function(balance) {
if (balance < 0.1 && balance !== 0) {
return balance * 1000 + ' mBTC';
}
return balance + ' BTC';
};
module.exports = strings;