title: How to use swift extension to get the IAP price in local currency
body: <p>I am learning swift on my own and I cannot seem to figure out how to implement the extension below. I have an app on the App Store with a functioning IAP. But I now need to indicate the price in the local currency and not simply in US$ before the user clicks the button to buy.</p>
  <p>I have read numerous posts about using an extension similar to the one below. However, I have been unable to get the cost to display as a String I can put in a label.</p>
  <pre><code>    extension SKProduct {
  /// - returns: The cost of the product formatted in the local currency.
  var regularPrice: String? {
      let formatter = NumberFormatter()
      formatter.numberStyle = .currency
      formatter.locale = self.priceLocale
      return formatter.string(from: self.price)
  }}
  </code></pre>
  <p>Among the methods I tried were:</p>
  <pre><code>label = SKProduct.regularPrice
  
  label = product.regularPrice
  </code></pre>
  <p>I tried putting in my product ID (&quot;com.afafaf.2323&quot;) but none of the attempts worked.</p>
  <p>Yes, this is similar to some other posts, but none of them explain the implemtation to the extent I need.</p>
  <p>I am clearly missing something easy, but I am not seeing it. Can someone please just show me how to use this extension properly?</p>