applied noFraction filter in controller

This commit is contained in:
Ivan Socolsky 2014-12-02 15:37:43 -03:00
parent 72cc5a1a28
commit 9628bbd222
2 changed files with 4 additions and 3 deletions

View File

@ -33,8 +33,8 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.setAlternativeAmount = function(w, tx, cb) {
rateService.whenAvailable(function() {
_.each(tx.outs, function(out) {
var valueSat = out.value * w.settings.unitToSatoshi;
out.alternativeAmount = rateService.toFiat(valueSat, $scope.alternativeIsoCode);
var valueSat = out.valueSat * w.settings.unitToSatoshi;
out.alternativeAmount = $filter('noFractionNumber')(rateService.toFiat(valueSat, $scope.alternativeIsoCode));
out.alternativeIsoCode = $scope.alternativeIsoCode;
});
if (cb) return cb(tx);
@ -56,6 +56,7 @@ angular.module('copayApp.controllers').controller('SendController',
}
if (tx.outs) {
_.each(tx.outs, function(out) {
out.valueSat = out.value;
out.value = $filter('noFractionNumber')(out.value);
});
}

View File

@ -50,7 +50,7 @@
'green' : btx.action == 'received',
'red': btx.action == 'sent',
'gray': btx.action == 'moved'}" ng-show="btx.alternativeAmount != null">
{{btx.alternativeAmount| noFractionNumber}} {{$root.wallet.settings.alternativeIsoCode}}
{{btx.alternativeAmount}} {{$root.wallet.settings.alternativeIsoCode}}
</span>
</div>
</div>