Set initial value on ion-select when ngModel is string but ion-select-option "value" is an integer

I have an ion-select setup as follows, the “attribute.value” is a string but the “option.id” on each ion-select-option is an integer, I need to set the initial value of the select based on “attribute.value”. What I have below worked fine on Ionic 3 but on Ionic 4 and Ionic 5 this doesn’t work, I assume because one is a string and one is an integer so it doesn’t think that they match, I believe on Ionic 3 it must have just converted the [value] on an ion-select-option to a string by default.

The “attributes” I am using are dynamic so they can be a string or an integer when they come from the datasource, therefore, I do not have the option of just changing it so that “attribute.value” is instead an integer when it reaches the page.

I effectively need a way of converting the “attribute.value” to an integer within the HTML in [(ngModel])] so that it matches with the correct ion-select-option and sets the correct initial value. How can I do this?

<ion-select [(ngModel)]="attribute.Value" interface="popover">
  <ion-select-option *ngFor="let option of attribute.Options" [value]="option.Id">{{option.Name}}</ion-select-option>
</ion-select>

I have struggled with this over and over again, and where I am at now is this: whenever dealing with forms, forget completely about numbers. Treat everything as strings. If you’re presenting numeric data, convert it first using toString(). If you need it as a number afterwards, convert it back once it’s out of the form (I use unary plus for this; there are other options).

Thank you for the reply, I have changed this so that my API now returns “option.Id” as a string instead of integer so that it matches the “attribute.Value” which is already a string.