Fix - 244 - Limit by 8 carateres before the comma
This commit is contained in:
parent
3fae07d5fa
commit
f51f68efde
1 changed files with 5 additions and 3 deletions
|
|
@ -9,7 +9,8 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
var satToBtc;
|
var satToBtc;
|
||||||
var SMALL_FONT_SIZE_LIMIT = 10;
|
var SMALL_FONT_SIZE_LIMIT = 10;
|
||||||
var LENGTH_EXPRESSION_LIMIT = 19;
|
var LENGTH_EXPRESSION_LIMIT = 19;
|
||||||
var LENGTH_COMMA_EXPRESSION_LIMIT = 8;
|
var LENGTH_BEFORE_COMMA_EXPRESSION_LIMIT = 8;
|
||||||
|
var LENGTH_AFTER_COMMA_EXPRESSION_LIMIT = 8;
|
||||||
var isNW = platformInfo.isNW;
|
var isNW = platformInfo.isNW;
|
||||||
|
|
||||||
var unitIndex = 0;
|
var unitIndex = 0;
|
||||||
|
|
@ -299,9 +300,10 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.pushDigit = function(digit) {
|
$scope.pushDigit = function(digit) {
|
||||||
if ($scope.amountModel.amount) {
|
if ($scope.amountModel.amount && digit != '.') {
|
||||||
var amountSplitByComma = $scope.amountModel.amount.split('.');
|
var amountSplitByComma = $scope.amountModel.amount.split('.');
|
||||||
if (amountSplitByComma.length > 1 && amountSplitByComma[1].length >= LENGTH_COMMA_EXPRESSION_LIMIT) return;
|
if (amountSplitByComma.length > 1 && amountSplitByComma[1].length >= LENGTH_AFTER_COMMA_EXPRESSION_LIMIT) return;
|
||||||
|
if (amountSplitByComma.length == 1 && amountSplitByComma[0].length >= LENGTH_BEFORE_COMMA_EXPRESSION_LIMIT) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scope.amountModel.amount && $scope.amountModel.amount.length >= LENGTH_EXPRESSION_LIMIT) return;
|
if ($scope.amountModel.amount && $scope.amountModel.amount.length >= LENGTH_EXPRESSION_LIMIT) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue