Well, you contradict yourself when you say the number should always be five digits long then say your app should display it as "00002" or "2". I'll assume you actually want the former? Here's a simple example assuming your number is int x
.
int x = 2;
NSString *string = [NSString stringWithFormat:@"%05d", x];