I am having an In-App-Purchase for an iPhone app.
I want to display the price in the users local currency in a UILabel. For this I need the price & currency in a
Here's the Swift version of the above answer using an extension
:
extension SKProduct {
func priceAsString() -> String {
let formatter = NumberFormatter()
formatter.formatterBehavior = .behavior10_4
formatter.numberStyle = .currency
formatter.locale = self.priceLocale
return formatter.string(from: self.price)! as String
}
}