I'm a newbie on angularJS.
I want to divide 2 numbers, but I want to round the result with two digits.
I try many things :
<input type="number" ng-model="var3" ng-value="var3 = Math.round((var1/var2)*100)/100" />
<input type="number" ng-model="var3" ng-value="var3 = (var1/var2).toFixed(2)" />
Do you have any ideas ?
var3is always equal tovar1/var2why do you want to have input for it? just display it as texttoFixed()example would work with 1 minor change, Angular returns a string, change the input type to text. I would also suggest changing the input to disabled that way the user knows it will be submitted but they aren't allowed to change the value.