Please find the fiddle
http://jsfiddle.net/q2SgJ/5/
<div ng-app=>
<div ng-controller=Ctrl>
WANTS: {{val | number:2}} in input elelent<br>
2 decimal in input: <input ng-model='val'> <br>
2 decimal in input: <input type=number step=0.01 ng-model='val'><br>
2 decimal in input: <input ng-model='val' value={{val |number:2}}> <br>
</div>
</div>
How can I restrict the decimal places to 2 digits in an INPUT field. As in the example {{val | number:2}}
works, but not sure how to use it to format the ng-model attached to an field. I could have formatted the data/model itself, but I have few values I like to keep the extra decimal, but only display 2 decimal.
Thanks.