Thanks a lot guys, %0*d did the trick! :)
Jean-Nicolas Jolivet
Jean-Nicolas Jolivet wrote:
I'm having an interesting problem... I'm trying to format a number
with padding zeros but I can't figure out how to do it in this
particular situation.
I know I can use a formatted string with something like
[stringWithFormat:@"%03d", 5], which would result in 005 but the
problem in this particular case is that the number of padding zeros (3
in my example) is a variable defined by the user... (let's say it
resides in an int variable named "int paddingZeros"....)
Is there an easy way I can pad a number with a variable amount of zeros?
Jean-Nicolas Jolivet
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/silvertab%40videotron.ca
This email sent to [EMAIL PROTECTED]
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]