You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
423 B

package com.example.jetsnack.ui.utils
import platform.Foundation.*
actual fun formatPrice(price: Long): String {
val priceAsDouble = price / 100.0
val formatter = NSNumberFormatter()
formatter.setLocale(NSLocale.currentLocale)
formatter.numberStyle = NSNumberFormatterCurrencyStyle
val numberPrice = NSNumber.numberWithDouble(priceAsDouble)
return formatter.stringFromNumber(numberPrice) ?: ""
}