I want to “stringify” a number and add zero-padding, like how printf("%05d") would add leading zeros if the number is less than 5 digits.
I want to stringify a number and add zero-padding, like how printf(%05d) would add
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use this:
5 here corresponds to 5 in
printf("%05d"). 10 is the radix, you can put 16 to print the number in hex.