setLocalizesFormat:
数字フォーマッタはローカライズフォーマットを使うかをセットします
-(void)setLocalizesFormat:(BOOL)flag:
解説
数字フォーマッタはローカライズフォーマットを使うかをセットします。
$マークと¥マークや小数点、桁区切り文字など地域情報に基づいてその地域の文字を変換するかをセットします。
ただし通貨を為替に応じて変換するわけではありません。
返り値
( void )
なし
引数
( BOOL )flag
YES/NO
フレームワーク
Foundation
クラス
NSNumberFormatter
Instance Methods
使用可能
10.0
参照
- localizesFormat
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSNumberFormatter *numFormat = [[NSNumberFormatter alloc] init] ; [numFormat setPositiveFormat:@"#,##0.00"]; [numFormat setLocalizesFormat:YES]; [myOutlet setFormatter:numFormat]; if ([numFormat localizesFormat]){ NSLog(@"YES"); }else{ NSLog(@"NO"); } } @end