Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert Long to String and keep leading zeroes if they exist

800638Oct 7 2009 — edited Oct 7 2009
Hello,

I am trying to convert a Long value to a String in my application, but each time, the leading zeroes are eliminated during the process. What is the easiest way to do this while keeping any leading zeroes if they exist?

Also, there may or may not be a leading zero and I have no guarantee on the minimum value of the number. I know it can never be greater than six digits, but that is all I will know at the time of conversion.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 4 2009
Added on Oct 7 2009
4 comments
667 views