var amount = NSNumber(int: 8880)
var _currencyFormatter = NSNumberFormatter()
_currencyFormatter.numberStyle = NSNumberFormatterStyle.DecimalStyle
//_currencyFormatter.currencyCode = "NT$ "
//_currencyFormatter.formatterBehavior = NSNumberFormatterBehavior.BehaviorDefault
//_currencyFormatter.negativeFormat = "-$#,##0"
_currencyFormatter.positiveFormat = "NT$ #,##0"
_currencyFormatter.stringFromNumber(amount)
輸出結果︰
NT$ 8,880
參考︰
留言
張貼留言