NSDecimalIsNotANumber
指定した十進数オブジェクトが数字かを返します数字でなければYESを返します
BOOL NSDecimalIsNotANumber ( const NSDecimal * decimal );
解説
指定した十進数オブジェクトが数字かを返します。数字でなければYESを返します。
返り値
引数
( const NSDecimal * )decimal
フレームワーク
Foundation
クラス
NSDecimalIsNotANumber
Function
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDecimalNumber *dNum1 = [[[NSDecimalNumber alloc] initWithString:@"3000.2344"] autorelease]; NSDecimal dec = [dNum1 decimalValue]; NSDecimal result; NSDecimalRound(&result, &dec , 3, NSRoundBankers); if (NSDecimalIsNotANumber(&result)){ NSLog(@"Not a number"); }else{ NSLog(NSDecimalString(&result,nil)); } } @end