浮点数转字符串 float value = 0.2; NSString* text = [[NSString alloc] initWithFormat:@"%f", value]; 整数转字符串 int value = 10; NSString* text = [[NSString alloc] initWithFormat:@"%d", value]; NSInteger 转字符串 NSInteger value = 10; NSString* text = [[NSString alloc] initWithFormat:@"%zd", value]; 浮点数转整数 float f = 0.2; int d = (int)f; 浮点数向下取整 float f = 0.2; int d = floorf(f); 浮点数向上取整 float f = 0.2; int d = ceilf(f); 浮点数保留两位四舍五入 float value = 1.23422; NSString* text = [[NSString alloc] initWithFormat:@"%.2f", value];