ios-unity/purchase/SKProduct+SKProductAdditions.m
2023-08-03 13:14:23 +08:00

20 lines
550 B
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
See LICENSE folder for this samples licensing information.
Abstract:
Creates a category for the SKProduct class.
*/
#import "SKProduct+SKProductAdditions.h"
@implementation SKProduct (SKProductAdditions)
/// - returns: The cost of the product formatted in the local currency.
-(NSString *)regularPrice {
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[formatter setLocale: self.priceLocale];
return [formatter stringFromNumber:self.price];
}
@end