I used below code snippet for currency formate casting, it's working fine up to iOS 12. but in iOS 13 now its giving different output of currency
let prise = 1000
let numberFormatter = NumberFormatter()
numberFormatter.usesGroupingSeparator = true
numberFormatter.numberStyle = .currency
numberFormatter.locale = Locale(identifier: "id_ID")
guard let result = numberFormatter.string(from: NSNumber(value: prise)) else {
return ""
}
print(result)
Previously it's return currency in proper indention formate like for 1000 it was Rp1.000 but now it's return Rp1000,00 in iOS 13.
Prise 1000000 then in old and as per Indonesian currency it was showing Rp1.000.000 but now i am getting Rp1000000,00
I want old currency formate is any can help me for it ?
You can just set minimumFractionDigits to 0 in your formatter.
numberFormatter.minimumFractionDigits = 0