在Swift3中似乎有很多语法的改变,我找不到这个currencyStyle的解决方案,我参考了文档中没有用来替代它的文档。如果有人遇到这个错误,你能点击下面的答案吗?我在下面提到的链接,它们在
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
}

引用的链接它只适用于swift2 Struggling with NSNumberFormatter in Swift for currency
发布于 2016-09-22 14:14:53
将currencyStyle更改为currency
改变这一点
amountFormatter.numberStyle = NumberFormatter.currencyStyle转到
amountFormatter.numberStyle =.currency

请参阅苹果APIreference Documents
https://stackoverflow.com/questions/39631494
复制相似问题