setFormat:
数字フォーマットに正の数、ゼロ、負の数のフォーマットを一度にセットします
-(void)setFormat:(NSString *)aFormat:
解説
数字フォーマットに正の数、ゼロ、負の数のフォーマットを一度にセットします。
「正の数」;「ゼロ」;「負の数」または「正の数」;「負の数」となります。
返り値
( void )
なし
引数
( NSString * )aFormat
フォーマット文字列
フレームワーク
Foundation
クラス
NSNumberFormatter
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSNumberFormatter *numFormat = [[NSNumberFormatter alloc] init] ; [numFormat setFormat:@"#,##0.00;0.00;-#,##0.00"]; [myOutlet setFormatter:numFormat]; NSLog([numFormat format]); } @end