【发布时间】:2018-05-10 22:13:57
【问题描述】:
XML 代码在这里:
<TextView
android:id="@+id/price_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="€0"
android:textAllCaps="true"
android:layout_marginTop="16dp"
android:textSize="16sp"
android:textColor="@android:color/black"/>
java代码:
//This method displays the given price on the screen.
private void displayPrice(int number) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
}
当我单击按钮时,出现sterlin 符号而不是euro 符号。我认为是链接“数字格式”,但我不知道。
你能帮帮我吗?我附上了我手机的屏幕截图。
我尝试学习安卓应用开发, 谢谢
当我点击按钮时,我看到了这个屏幕:
【问题讨论】:
标签: java android number-formatting