Reputation: 6842
How can i get the last digit of an integer (or NSInteger) outputted to integer?
example:
int time = CFAbsoluteGetCurrent(); int lastDigit;
Upvotes: 17
Views: 14038
Reputation: 98984
Use modulo:
int lastDigit = time % 10;
Upvotes: 41