I want to bind input value 0.00 to text box then, if I changed input to 20 then on blur set 20.00
<input type="text" valid-decimal-number style="text-align:right" ng-model="Amount" ng-blur="ConvertToDecimal(Amount)">
angular script :
//converting value to decimal
$scope.ConvertToDecimal = function (val) {
$scope.Amount = eval(val).toFixed(2);
}
I am getting by using this code but, for every time I'm writing, how to create custom directive for this
I tried like this also but not working.
<input type="text" valid-decimal-number style="text-align:right" ng-model="Amount" ng-blur="'Amount=(Amount).toFixed(2)'">