SWIFT中格式化数字比较常用的应该就是以下几种格式了。
var formatter = NSNumberFormatter() //formatter.numberStyle = NSNumberFormatterStyle.CurrencyStyle //$72,900 formatter.numberStyle = NSNumberFormatterStyle.DecimalStyle //72,900 //formatter.numberStyle = NSNumberFormatterStyle.PercentStyle //90% var str = formatter.stringFromNumber(number)!