I have a view tht has the following requirements:
- HTML input
type
must benumber
- Programatically set the value of the model attribute of that input with 2 trailing decimals
- Allow for user input to modify that value
Now, seting the value programatically as 1.20
for that value to display in the input is complicated:
parseFloat(1.20)
returns1.2
(1.20).toFixed(2)
returns a string'1.20'
, for which AngularJS fails when attempting to set the value
Any ideas?