limits one decimal in amount value, stops user from going past 2 decimal places with alternate currency

This commit is contained in:
Jamal Jackson 2016-10-10 12:08:21 -04:00
commit a4b2575f68

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();