I am facing a problem with an input shown below. The issue arises when trying to convert the budget
numeric
property into thousands separators (for example, 1,000
).
<ion-input [ngModel]="project.budget | thousandsSeparatorPipe"
(ngModelChange)="project.budget=$event;calculateContingency()"
formControlName="budget" type="text"></ion-input>
Unfortunately, it does not seem to be working as expected:
calculateContingency(eve:any) {
this.project.contingency = ((Number(this.project.budget) * this.project.contingencyPercentage) * 1 / 100);
this.changeDetectorRef.detectChanges();
}
The output appears like this:
https://i.sstatic.net/g9WeW.png
Could you advise me on how to resolve this issue? Alternatively, is there a way to use the budget
model without the thousand separators? If so, I can then pass it to the calculation method mentioned above.