How to treat 1 and the number of decimals should be zero eg) 1.000 as same show the alert pop up number should be same.And the maximum number length of the texbox is 7.
eg)1 and 1.00000001 be different
And the number be 1 and 1.01 as different.Here I have numeric value 1 and numeric value 1. any decimal number.
if the number is 1 and 1.00 means show alert value same and 1.01, or 1.001 or any decimals after number it will be considered as different.
Here is my sample code:
<!doctype html>
<html ng-app>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<div ng-controller="Ctrl">
<input type="text" ng-model="contractDetailsScreen.percent" maxlength="7" numbers-only="numbers-only" />
<button ng-click="actionme()">click</button>
</div>
</body>
</html>
function Ctrl($scope) {
$scope.actionme = function(){
if($scope.contractDetailsScreen.percent){
alert('value same');
}
else{
alert("value diffrent");
}
};
}