I need to update an input such that if is an integer, you add 2 zeros.
Input: 12 Output: 12.00 (In the same input-text)
<body ng-app="">
<script>
function Controller($scope) {
$scope.change = function() {
};
}
</script>
<div ng-controller="Controller">
<input type="text" ng-model="value" ng-change="change()" />
{{value | number:2}}
</div>
</body>
It could be done within $scope.change, but it would take more lines of code. Is there a more direct way to implement it? such as {{value | number 2}}.
Thanks in advance.