05
2017
10

IPA 笔记

1、 检索产品信息

       //MARK: - 格式化产品的价格
    func formattedPrice(product:SKProduct) -> String {

// NSNumberFormatter * numberFormatter = [[NSNumberFormatter alloc] init];
        let numberFormatter:NumberFormatter = NumberFormatter.init();


// [numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
        numberFormatter.formatterBehavior = NumberFormatter.Behavior.behavior10_4;

// NumberFormatter.setDefaultFormatterBehavior()


// [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
        numberFormatter.locale = product.priceLocale;
// [numberFormatter setLocale:product.priceLocale];
// NSString * formattedPrice = [numberFormatter stringFromNumber:product.price];

        return  numberFormatter.string(from: product.price)!;

    }
上一篇:RecylerView的使用 下一篇:TextView两端对齐