Skip to content

Commit

Permalink
scale amounts for units
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofbyteball committed Jan 20, 2017
1 parent fcc2045 commit df769d2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/js/services/correspondentListService.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,19 @@ angular.module('copayApp.services').factory('correspondentListService', function
function getAmountText(amount, asset){
if (asset === 'base'){
var walletSettings = configService.getSync().wallet.settings;
var unitToBytes = walletSettings.unitToBytes;
var unitValue = walletSettings.unitValue;
var unitName = walletSettings.unitName;
if (amount !== 'all')
amount /= unitToBytes;
amount /= unitValue;
return amount + ' ' + unitName;
}
else if (asset === constants.BLACKBYTES_ASSET)
return amount + ' blackbytes';
else if (asset === constants.BLACKBYTES_ASSET){
var walletSettings = configService.getSync().wallet.settings;
var bbUnitValue = walletSettings.bbUnitValue;
var bbUnitName = walletSettings.bbUnitName;
amount /= bbUnitValue;
return amount + ' ' + bbUnitName;
}
else
return amount + ' of ' + asset;
}
Expand Down

0 comments on commit df769d2

Please sign in to comment.