I am implementing an ionic mobile app. in the typescript class of my component I have an array of numbers (prices). some are whole numbers and some are with two decimal places. I want to display this in the component as a column of price list. For this I am using with alignment set to right. For the price list to align properly, I need to display the whole numbers with two zero decimals. How can I do this
type script
price1 = 21.23;
price2 = 20;
in html in ionic component
<ion-grid>
<on-row>
<ion-col>
<ion-label class="ion-text-end">{{price1}}</ion-label>
</ion-col>
</on-row>
<on-row>
<ion-col>
<ion-label class="ion-text-end">{{price2}}</ion-label>
</ion-col>
</on-row>
</ion-grid>
I want it aligned as,
21.23
20.00
But it's not. Not even the text get aligned to the right.
Can someone advise how I can achieve this please.