0

Seems like there is a bug with NSNumberFormatter on iOS14 when your region is set to Cambodia where the amount is being formatted to "1.234,56" which is not the format being used there.

enter image description here

It was okay on iOS13. I cannot see any references in regards to this change.

Is there any workaround for this?


UPDATE: Issue still exists with iOS 14.2

jamieaguinaldo
  • 129
  • 1
  • 2
  • 13
  • The currency also changed before/after the amount. Strange. I don't live there, so I don't know if there have been a change, or if it's a fix, or a new bug, but if it's a bug, I wouldn't open a radar. – Larme Sep 21 '20 at 09:10
  • FWIW in simulator the screen is similar to your iOS 14 one for iPad and on macos it is similar to your 13. – skaak Sep 21 '20 at 18:58

1 Answers1

0

I think you can modify the parameters for NumberFormatter to suit your needs. Something like this

let formatter = NumberFormatter()
//formatter.locale = Locale.init(identifier: Locale.current.identifier)
formatter.numberStyle = .currency
formatter.currencyGroupingSeparator = ","
formatter.currencyDecimalSeparator = "."
//by default its 3
formatter.maximumFractionDigits = 2

print(formatter.string(from: 1000000.00))
//Outputs Optional("TND 1,000,000.00")
Dharman
  • 30,962
  • 25
  • 85
  • 135
nikhil.thakkar
  • 1,093
  • 7
  • 12