I want to print it out with a zero on the left side of the number

Asked 2 years ago, Updated 2 years ago, 26 views

from 0001 to 9999 I want to print 1 as 0001, is it possible?

java zero-pad

2022-09-22 22:35

1 Answers

String.format("%05d", yournumber);

The number you put in your number is printed with 5 digits, and fill in the empty space with 0.


2022-09-22 22:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.