Merge pull request #333 from jamal-jackson/feature/minor_amount_view_fixes

limits one decimal in amount value, stops user from going past 2 deci…
This commit is contained in:
Matias Alejo Garcia 2016-10-10 13:25:16 -03:00 committed by GitHub
commit 6f704aede2

View file

@ -92,6 +92,8 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.pushDigit = function(digit) {
if ($scope.amount && $scope.amount.length >= LENGTH_EXPRESSION_LIMIT) return;
if ($scope.amount.indexOf('.') > -1 && digit == '.') return;
if($scope.showAlternativeAmount && $scope.amount.indexOf('.') > -1 && $scope.amount[$scope.amount.indexOf('.') + 2]) return;
$scope.amount = ($scope.amount + digit).replace('..', '.');
checkFontSize();