Merge pull request #3768 from igrechuhin/crash

[ios] Workaround for crash on no locale.
This commit is contained in:
Vlad Mihaylenko 2016-07-12 08:30:25 -07:00 committed by GitHub
commit b9aa352c8e

View file

@ -127,6 +127,8 @@ void initFieldsMap()
}
NSNumberFormatter * currencyFormatter = [[NSNumberFormatter alloc] init];
if (currencyFormatter.currencyCode.length != 3)
currencyFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
currencyFormatter.numberStyle = NSNumberFormatterCurrencyStyle;
currencyFormatter.maximumFractionDigits = 0;
string const currency = currencyFormatter.currencyCode.UTF8String;