Merge pull request #4672 from JDonadio/bug/format-amount

Fix format amount
This commit is contained in:
Gustavo Maximiliano Cortez 2016-08-10 16:33:39 -03:00 committed by GitHub
commit 0f425e0346

View file

@ -140,8 +140,9 @@ angular.module('copayApp.controllers').controller('inputAmountController', funct
};
$scope.finish = function() {
var amount = $scope.showAlternativeAmount ? fromFiat(evaluate(format($scope.amount))).toFixed(unitDecimals) : evaluate(format($scope.amount));
var alternativeAmount = $scope.showAlternativeAmount ? evaluate(format($scope.amount)) : toFiat(evaluate(format($scope.amount)));
var _amount = evaluate(format($scope.amount));
var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals);
var alternativeAmount = $scope.showAlternativeAmount ? _amount : toFiat(_amount);
if (amount % 1 == 0) amount = parseInt(amount);