From a4b2575f6865d9c9f36b50dabf53338b9713d379 Mon Sep 17 00:00:00 2001 From: Jamal Jackson Date: Mon, 10 Oct 2016 12:08:21 -0400 Subject: [PATCH] limits one decimal in amount value, stops user from going past 2 decimal places with alternate currency --- src/js/controllers/amount.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index baa1cfdc4..dd8623cfa 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -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();