This commit is contained in:
Matias Alejo Garcia 2016-08-18 11:45:30 -03:00
commit 02c8cb44d6
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
10 changed files with 57 additions and 56 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, walletService, platformInfo, lodash, configService, go, rateService, $stateParams, $window, $state, $log) {
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicScrollDelegate, platformInfo, lodash, configService, go, rateService, $stateParams, $window, $state, $log, txFormatService) {
var unitToSatoshi;
@ -144,7 +144,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
if (lodash.isNumber(result)) {
$scope.globalResult = isExpression(val) ? '= ' + processResult(result) : '';
$scope.amountResult = $filter('formatFiatAmount')(toFiat(result));
$scope.alternativeResult = walletService.formatAmount(fromFiat(result) * unitToSatoshi, true);
$scope.alternativeResult = txFormatService.formatAmount(fromFiat(result) * unitToSatoshi, true);
}
};
@ -152,7 +152,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
if ($scope.showAlternativeAmount)
return $filter('formatFiatAmount')(val);
else
return walletService.formatAmount(val.toFixed(unitDecimals) * unitToSatoshi, true);
return txFormatService.formatAmount(val.toFixed(unitDecimals) * unitToSatoshi, true);
};
function fromFiat(val) {