0

我正在寻找可以显示 NSLocale 货币格式的代码。

我使用了以下代码

    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init] ;
        [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
        [formatter setLocale:skProduct.priceLocale];
        NSLog(@"formatter%@",formatter);

        NSLog(@"%@",skProduct.priceLocale);  ////  i want to print NSLocale value

      NSString*  currencyString = [formatter stringFromNumber:skProduct.price];
  NSLog(@"currencyString price %@",currencyString);

我如何根据 NSLocale 显示确切的价格金额,当我尝试 NSLog(@"%@",skProduct.priceLocale); 它显示像一些内存位置..请帮助我

4

1 回答 1

0

尝试这个:

  NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init] ;
  [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
  NSString*  currencyString = [formatter currencySymbol];
  NSLog(@"currencyString %@",currencyString);
于 2013-07-27T19:15:01.703 回答