I’m using iOS, and I want to be able to multiply the decimal after one answer is solved. This is what I have so far:
float minutes = ([time.text floatValue]);
float distance = minutes/([miles.text floatValue]);
label.text = [[NSString alloc] initWithFormat:@"%.2f", distance];
Is it possible to just multiply the remainder by 60 after this is done?
For example, if I put in 50 divided by 3, it gives me 16.66 as an answer. I want to multiply this .66.
I’m going to guess at what you’re asking since I cannot discern it from your question. It looks to me like you are trying to calculate a pace from a time and distance and display it in units of time/distance. If this is what you’re trying to do, then your code should look something like this:
To display the pace correctly in
min:secformat, you can do this:Now you can display the pace with
If that’s not what you’re doing, then please clarify your question.