2012-05-26 3 views
0

경고보기에 이중을 표시하는 데 문제가 있습니다. 문자열은 AlertView에서 계속 0으로 표시됩니다. 미리 감사드립니다!TextBox Double로 표시 한 다음 문자열로 표시 AlertView

double binRadius = [txtRadiusInches.text doubleValue]/12 + [txtRadiusFeet.text doubleValue]; 
NSString *myString = [NSString stringWithFormat:@"%d", binRadius]; 

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Estimatated Amount" 
               message:myString 
               delegate:self 
             cancelButtonTitle:@"Continue" 
             otherButtonTitles:@"Clear All", nil]; 

[alert show]; 
%d

답변

1

(및 %i)은 정수 (소수점)의 형식을 지정한다. 부동 소수점 숫자의 경우 %f을 사용해야합니다.

+0

감사합니다. 문제가 해결되었습니다. – brmcdani44