Tag: locale

[問題] iOS 上如何顯示貨幣金額 (localized currency)

NSLocale *priceLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_TW"];
NSNumberFormatter *formatter = [NSNumberFormatter new];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[formatter setLocale:_product.priceLocale];
NSString *localizedPrice = [formatter stringFromNumber:price];
Tags : ,