'how to show number with comma separated in text box angular, getting incorrect thousand separator
how to show number with comma separated. like this 1,000.
<kendoTextBox ControlId="Amount" [ControlLabel]="'Amount*'" [maxLength]="100"
[TextValue]="Amount" (txtBoxchangeEvent)="onChangeAmount($event)" ></kendoTextBox>
onChangeAmount(e){
this.Amount = e.TextValue.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
output -2,0,0,0,000
expected op-2,000,000
Solution 1:[1]
All you need is the DecimalPipe pipe.
You can find it pretty easy in the angular documentation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dragan Petrovic |
