Merge pull request #127 from Bitcoin-com/wallet/task/344
Fix - 344 - Add comma like first character
This commit is contained in:
commit
1c2ced2366
1 changed files with 9 additions and 3 deletions
|
|
@ -307,12 +307,18 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
}
|
||||
|
||||
if ($scope.amountModel.amount && $scope.amountModel.amount.length >= LENGTH_EXPRESSION_LIMIT) return;
|
||||
if (($scope.amountModel.amount.indexOf('.') > -1 || $scope.amountModel.amount == '') && digit == '.') return;
|
||||
if ($scope.amountModel.amount.indexOf('.') > -1 && digit == '.') return;
|
||||
if ($scope.amountModel.amount == '0' && digit == '0') return;
|
||||
if (availableUnits[unitIndex].isFiat && $scope.amountModel.amount.indexOf('.') > -1 && $scope.amountModel.amount[$scope.amountModel.amount.indexOf('.') + 2]) return;
|
||||
|
||||
if ($scope.amountModel.amount == '0' && digit != '.') { $scope.amountModel.amount = ''}
|
||||
|
||||
if ($scope.amountModel.amount == '0' && digit != '.') {
|
||||
$scope.amountModel.amount = '';
|
||||
}
|
||||
|
||||
if ($scope.amountModel.amount == '' && digit == '.') {
|
||||
$scope.amountModel.amount = '0';
|
||||
}
|
||||
|
||||
$scope.amountModel.amount = ($scope.amountModel.amount + digit).replace('..', '.');
|
||||
checkFontSize();
|
||||
$scope.processAmount();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue