Hi all,
I have a question: why do we need use NumberFormat.getCurrencyInstance() ? In the book we set price of the pizza in this way:
val currencyFormatter = remember { NumberFormat.getCurrencyInstance() }
val price = currencyFormatter.format(pizza.price)
Text(
text = stringResource(R.string.place_order_button, price).toUpperCase(Locale.current)
)
Isn’t easy just use “.toString” ? I mean this way:
Text(
text = stringResource(R.string.place_order_button).toUpperCase(Locale.current) + " "
+ pizza.price.toString()
)
thank you