Hello all I'm trying to convert a string to a double and it doesn't work. However if I convert it to an integer it does work
this is my code snippet
int myDuration = [myDurationString integerValue];
int conversionMinute = myDuration / 60;
if( myDuration < 60 )
{
[appDelegate.rep1 addObject:[NSString stringWithFormat:@"%d",myDuration]];
NSLog(@"show numbers %d", myDuration);
}
else
{
[appDelegate.rep1 addObject:[NSString stringWithFormat:@"%d",conversionMinute]];
NSLog(@"show numbers %d", conversionMinute);
}
Now if I try to do
double myDuration = [myDurationString doubleValue];
double conversionMinute = myDuration / 60;
then it doesn't work. It gives me an output of 0.
So the integerconversion works but somehow the double doesn't does anybody have an idea why?