Decimal one place input type only number

I’m using ionic latest version 3.9.2. and I’m facing one problem. I have one input box. input type number, when user input in text box they allow only one digit after the decimal. and in input box maximum only one decimal allow not more than one.

Examples: 
1) 1407.1
2) 6449496.8
3) 1.1

Like this only user can input one digit after decimal

My Html Code

 <ion-item>
    <ion-label fixed>TECHLOG:</ion-label>
    <ion-input type="number" [ngModel]="mymodel" (ngModelChange)="onChangeTech($event)"></ion-input>
 </ion-item>
My ts file code

  onChangeTech(event) {
    alert(event)
  }

In the alert, I got the number what ever I type, but don’t know how to forcefully stop after one decimal in my input box.

Assign whatever you want to mymodel.

1 Like