I am trying to add currency symbol with the cost using Transformations of Live Data object, but it is not importing.
private val _price = MutableLiveData<Double>()
val price: LiveData<String> = Transformations.map(_price) {
NumberFormat.getCurrencyInstance().format(it)
}
Please debug
if you are using
androidx.lifecycle
with 2.6.0 or newer version then you should use the following code.Your Example
My Example