2010-10-22 4 views

Répondre

1
if ([yourString doubleValue] % 1 == 0) { 
    [yourString setString:[NSMutableString stringWithFormat:@"%d", [yourString intValue]]]; 
} 
+0

Vous souhaiterez peut-être changer la valeur plutôt que la convertir. [NSString stringWithFormat: @ "%. 0f"]; – jessecurry

Questions connexes