I have an angular2 app that needs to show ALWAYS two decimals in inputs after some calculations. But although in the component I force to have two decimals, in the input it shows it with zero decinmal, one decimal or the decimals that the number has but what I need is to show always two.
In the controller I force to have two decimals in this way
return +(this.getCost() * this.getQuantity()).toFixed(2);
But when I show that, the result can have different decimals size
<input name="number" pattern="^[0-9]+(\.[0-9]{1,2})?" step="0.01" formControlName="number" type="button" class="form-control" id="number" >
Adding that I;m using TypeScript and the field type is number (which I think is causing the rounded)