I want to generate incremental receipt numbers like this format "00000001". Every time new transaction happen, receipt number should increase by 1.
0000001
0000002
0000003
0000010
0000011
0000100
0000101
So, how could I implement this type of number format. Is there any special number formats in objective C?
If your numbers are integers and only the output matters, you can do:
NSString * output = [NSString stringWithFormat:@"%07d", integer];
to have the number be formatted with 7 digits, leading zeroes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With