Thanks for the reply. I'm not actually doing number formatting, but rather locale-sensitive numeric expression evaluation.
For example in the US:
"123,456 + 10,000 = 133,456 "
// Locale(identifier: "en_US")
In Germany:
"123.456 + 10.000 = 133.456"
// Locale(identifier: "en_DE")
Or with a custom grouping separator:
"123’456 + 10’000 = 133’456"
// How to create & test this locale programmatically?
I have tests for standard locales, but a case was reported by a customer where number recognition was failing for a custom grouping separator. The only way for me to test this at the moment is to set this custom locale in my own macOS System Preferences, which is a bit fragile. I'd like for this test to be automated, like I have for the standard locales.
Topic:
App & System Services
SubTopic:
General
Tags: