Float number is not processed
Hello
I try to set default value 2.5 (ng-value="{{setValue}}") My mask is "99?9?9?9?.?99" I have value "2.5" in field but i get "25"
$scope.setValue = 2.5; $scope.maskModel;
<input type='text' ng-value='{{setValue}}' ng-model="maskModel" mask='99?9?9?9?.?99' mask-restrict='reject'>
Plunker: http://plnkr.co/edit/1fFQezeZsUol0U7DlJKe?p=preview
Help me please
Thank you
The problem is in your mask regex.
You are requiring the number two have 2 decimals after the float point, but you are only providing one in your $scope.setValue. Change your mask regex, add a question mark at the end and it will work.
e.g. mask='99?9?9?9?.99?'
I resolved problem with help custom filter. And in ng-repeat with help re-initialization variable Plunker: http://plnkr.co/edit/C6KEm2KCEtjLHRgUxNJ6?p=preview