Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nativescript concatenate text use Label

I want to combine string in Label. The result i want is : USD 3000, price number 3000 from database. So i use code :

<Label row="2" col="1" text="USD {{ price }}" />

but not work and show like this :

USD {{ price }}

Can i directlly concatenate string in text label ? or any clue about this. Thanks anyway

like image 629
Pamungkas Jayuda Avatar asked Dec 14 '22 06:12

Pamungkas Jayuda


2 Answers

I think it should be like this:

<Label text="{{ 'USD' + price }}" />
like image 129
Dean Le Avatar answered Dec 21 '22 09:12

Dean Le


Nativescript Angular the format is as follows:

 <Label [text]="'Amount: ' + item.Gross"></Label>

OR use a pipe to denote the currency:

<Label [text]="item.Gross | currency:'USD':true" ></Label>
like image 37
Bhail Avatar answered Dec 21 '22 09:12

Bhail