Swift NSNumberFormatter CurrencyStyle Without Symbol
Swift NSNumberFormatter CurrencyStyle Without Symbol
此问题已在 objective-c here 中得到解答。我怎样才能在 Swift 中做到这一点?
import UIKit
let nf = NumberFormatter()
nf.currencySymbol = ""
nf.numberStyle = .currency
let stringForNumber = nf.string(for: 100) // "100.00"
此问题已在 objective-c here 中得到解答。我怎样才能在 Swift 中做到这一点?
import UIKit
let nf = NumberFormatter()
nf.currencySymbol = ""
nf.numberStyle = .currency
let stringForNumber = nf.string(for: 100) // "100.00"