1

Seems to be many syntax's changed in Swift3 , I can't able to find the solution for this currencyStyle i referred the documentation didn't for replacement for this. If any one faced this error can you please hit answer below? the links i referred i mentioned below that works in

func getCurrencyFormat(amount: Double) -> NSString
{
    let amountFormatter = NumberFormatter()
    amountFormatter.numberStyle = NumberFormatter.currencyStyle -- ///ERROR
    amountFormatter.locale = NSLocale.system
    return amountFormatter.string(from: amount as NSNumber)! as NSString
}

enter image description here

Refered link it works for only swift2 Struggling with NSNumberFormatter in Swift for currency

Community
  • 1
  • 1
Sanju
  • 1,148
  • 11
  • 26

1 Answers1

6

currencyStyle is changed into currency

change this

amountFormatter.numberStyle = NumberFormatter.currencyStyle

into

amountFormatter.numberStyle =.currency

enter image description here

see the apple APIreference Documents

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143