I have weight values, they can be like 75kg and 75.5kg.
I want to have this values two styles: 75kg, 75.5kg, but NOT 75.0kg. How can I do it?
I have this solution, but I not like it
//show difference in 75 and 75.5 values style
NSString *floatWeight = [NSString stringWithFormat:@"%.1f",weightAtThePoint.floatValue];
NSString *intWeight = [NSString stringWithFormat:@"%.0f.0",weightAtThePoint.floatValue];
NSString *resultWeight;
if ([floatWeight isEqualToString:intWeight]) {
resultWeight = [NSString stringWithFormat:@"%.0f",weightAtThePoint.floatValue];
} else {
resultWeight = floatWeight;
}