fix non equiv bch
This commit is contained in:
parent
aa61d7915d
commit
d074a7da7f
2 changed files with 12 additions and 2 deletions
|
|
@ -304,7 +304,14 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
$scope.globalResult = isExpression($scope.amount) ? '= ' + processResult(result) : '';
|
||||
|
||||
if (availableUnits[unitIndex].isFiat) {
|
||||
$scope.alternativeAmount = txFormatService.formatAmount(fromFiat(result) * unitToSatoshi, true);
|
||||
|
||||
var a = fromFiat(result);
|
||||
if (a) {
|
||||
$scope.alternativeAmount = txFormatService.formatAmount(a * unitToSatoshi, true);
|
||||
} else {
|
||||
$scope.alternativeAmount = 'N/A'; //TODO
|
||||
$scope.allowSend = false;
|
||||
}
|
||||
} else {
|
||||
$scope.alternativeAmount = $filter('formatFiatAmount')(toFiat(result));
|
||||
}
|
||||
|
|
@ -321,6 +328,8 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
};
|
||||
|
||||
function toFiat(val) {
|
||||
if (!rateService.getRate(fiatCode)) return;
|
||||
|
||||
return parseFloat((rateService.toFiat(val * unitToSatoshi, fiatCode, availableUnits[unitIndex].id)).toFixed(2));
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@
|
|||
</div>
|
||||
<div ng-class="{'amount__results--minimize': smallFont, 'amount__results--standard': !smallFont, 'amount__results--placeholder': amountResult}" ng-click="changeAlternativeUnit()">
|
||||
<div class="amount__result" ng-show="globalResult">{{globalResult}} {{unit}}</div>
|
||||
<div class="amount__result-equiv">≈ {{alternativeAmount || '0.00'}} {{alternativeUnit}}</div>
|
||||
<div class="amount__result-equiv" ng-show="alternativeAmount">≈ {{alternativeAmount || '0.00'}} {{alternativeUnit}}</div>
|
||||
<div class="amount__result-equiv" ng-show="!alternativeAmount"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue