mobile only - fix float point

This commit is contained in:
Javier 2016-07-22 17:15:11 -03:00
commit 16363562b1
5 changed files with 201 additions and 8 deletions

View file

@ -40,11 +40,10 @@ angular.module('copayApp.controllers').controller('inputAmountController', funct
};
$scope.pushDigit = function(digit) {
var amount = $scope.showAlternativeAmount ? $scope.alternativeAmount : $scope.amount;
if (amount.toString().length >= 10) return;
if (amount == 0 && digit == 0) return;
var amount = $scope.showAlternativeAmount ? $scope.alternativeAmount.toString() : $scope.amount.toString();
if (amount.length >= 10) return;
if (amount == '0' && digit == 0) return;
var val = amount ? amount + digit : digit;
processAmount(val);
};
@ -137,7 +136,7 @@ angular.module('copayApp.controllers').controller('inputAmountController', funct
} catch (e) {
return null;
}
if (result == 'Infinity') return null;
if (result == 'Infinity' || lodash.isNaN(result)) return null;
return result;
};