Calculating two numbers ending with the dot decimal separator

Hi there, I am somewhat familiar with Angular and just got into Ionic Framework.

I’m facing a problem. I’m trying to calculate two numbers and displaying the total below the two input fields. Calculation works as expected if I input the numbers like: 1 or 1.0 but inputting 1. (without number after dot) returns null for the field. Using comma as decimal separator won’t return null though. In Angular, using (input) null won’t be returned even if the dot is used as decimal separator. So the behavior is different I guess.

In template I have code as follows:

<b>1st input</b> <ion-input type="number" (ionChange)="calculate()" [(ngModel)]="firstInput"></ion-input>
<b>2nd input</b> <ion-input type="number" (ionChange)="calculate()" [(ngModel)]="secondInput"></ion-input>
<b>Total:</b> {{ total }}

And in component:

firstInput = null;
secondInput = null;
total = null;
...
calculate() {
   this.total = this.firstInput + this.secondInput;
}

Any help? Thanks in advance.