I know this is stupid... very stupid....
I just want to display a percentage. How simple this should be, but my output is always 0
I've tried NSInteger, NSNumber, %d, %f%g
I've searched all over the internet and can't seem to find info about something so elementary
i would expect to see 40% as my output
I just want to display a percentage. How simple this should be, but my output is always 0
Code:
double actualPercentage = (4/10)*100;
NSString *finalPercent = [NSString stringWithFormat:@"%d",actualPercentage];
finalPercent = [finalPercent stringByAppendingString:@"%"];
scorePercent.text = finalPercent;
I've tried NSInteger, NSNumber, %d, %f%g
I've searched all over the internet and can't seem to find info about something so elementary
i would expect to see 40% as my output