1.获取货币符号和金额
在内购查询商品回调方法中获取
<code>
-(void)productsRequest:(SKProductsRequest*)request didReceiveResponse:(SKProductsResponse*)response {
for(SKProduct* subProductin products) {
NSString* currencySymbol = [subProduct.priceLocale objectForKey:NSLocaleCurrencySymbol];//这里获取到的就是货币符号,例如:¥、$等等
NSNumberFormatter*numberFormatter = [[NSNumberFormatter alloc]init];
[numberFormattersetFormatterBehavior:NSNumberFormatterBehavior10_4];
[numberFormattersetNumberStyle:NSNumberFormatterCurrencyStyle];
[numberFormattersetLocale:subProduct.priceLocale];
NSString* formattedPrice = [numberFormatterstringFromNumber:subProduct.price];//这里获取到的就是货币符合和金额,例如:¥6.00,$0.99
break;
}
}
</code>