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 に答える