简体   繁体   English

Nativescript连接文本使用Label

[英]Nativescript concatenate text use Label

I want to combine string in Label. 我想在Label中组合字符串。 The result i want is : USD 3000, price number 3000 from database. 我想要的结果是:3000美元,数据库价格3000。 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 不管怎么说,还是要谢谢你

我想它应该是这样的:

<Label text="{{ 'USD' + price }}" />

Nativescript Angular the format is as follows: Nativescript Angular的格式如下:

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

OR use a pipe to denote the currency: 或使用管道来表示货币:

<Label [text]="item.Gross | currency:'USD':true" ></Label>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM