我有:
<Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Price, StringFormat='{0:F0} $'}" XAlign="Center" YAlign="Center" TextColor="#2bff00" FontAttributes="Bold" FontSize="Small" HorizontalOptions="CenterAndExpand"/>
但是我的物件屬性是:
JsonProperty("price_usd")]
public decimal? Price { get; set; }
所以真正的價值是:"price_usd":"3824.56"而我的標簽顯示 3824 沒有逗號?
uj5u.com熱心網友回復:
查看檔案中的數字格式字串。另外,這里有一些簡單的例子:
String.Format("{0:0.##}", 123.4567); // "123.46"
String.Format("{0:0.##}", 123.4); // "123.4"
String.Format("{0:0.##}", 123.0); // "123"
您可以在.xaml.
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/388631.html
