@numetalsour/ngx-number
v1.0.6
Published
format(onkey) & custom format
Downloads
6
Maintainers
Readme
Angular 14+ Number(input only numbers)
format(onkey) & custom format
Install project with npm
npm i @numetalsour/ngx-number --save
Parameters
| attributes | type | default value | |-----------|-------|---------| | allowDecimals | boolean | false | | allowSign | boolean | false | | decimalSeparator | string | '.' | | canPaste | boolean | true |
Usage
...
import { NgxNumberModule } from '@numetalsour/ngx-number';
...
@NgModule({
declarations: [
AppComponent,
],
imports: [
...
NgxNumberModule
...
]
})
export class AppModule { }
Example
<form [formGroup]="form">
<mat-form-field>
<mat-label>Number</mat-label>
<input
matInput
formControlName="number"
ngxNumber
[allowDecimals]="false"
[allowSign]="false"
[decimalSeparator]="'.'"
[canPaste]="true" >
</mat-form-field>
</form>
<input ngxNumber [(ngModel)]="rut" >