Facing problem in formatting float value into time format
Actually I need to format my timeinterval which is float value into 00'00
and after 60 seconds 01'00 ... 01'01 and after next 60 seconds 02'00..02'01 and so one.
float mintime;
if ([self.timeField floatValue] < 0.60)
{
interval = [self.startTime timeIntervalSinceNow];
interval = (-1 * interval);
mintime = interval / 60.0;
self.timeField = [NSString stringWithFormat:@"%00'f",mintime];
self.navigationItem.title = self.timeField;
NSLog(@"%@",self.timeField);
}
else {
mintime = (interval * 60.0)/ 36.0 ;
self.timeField = [NSString stringWithFormat:@"%f",mintime];
self.navigationItem.title = self.timeField;
}
I need to format some float values starting from 0.1123..0.231212323 and so on
|