So, I'm not sure if this is really as super basic as it sounds or not, but here's a couple of thoughts that might help:
Assuming it's an integer, can you simply test for it being 10,000 or greater (or -10,000 or less)?
if (abs(numberToTest) > 9999) {
// Number has 4 or more digits
} else {
// Number has 3 or fewer digits
}
Alternatively, if you're dealing with decimal values, you could try this:
NSString *stringToTest = [NSString stringWithFormat:@"%f", numberToTest];
// If you want to exclude the decimal place from the calculation
stringToTest = [stringToTest stringByReplacingOccurrencesOfString:@"."
withString:@""];
// If you want to include a negative sign from the calculation
stringToTest = [stringToTest stringByReplacingOccurrencesOfString:@"-"
withString:@""];
if (stringToTest.length > 4) {
// String has 5 or more digits
} else {
// String has 4 or fewer digits
}
Anyway, you didn't give a ton of detail, but maybe this solves your problem.