Possible Duplicate:
Left padding integers with zeros in Java
I have a problem. i am working on a android app
I have a long timestap and a string that i need to combine. The catch is that if the long is less than 8 digits, then i need to display 0's to make it look good.
Example
long time = 311;
how can i fill it out so it will be
00000311
long time2 = 3111
00003111
I hope any of you an help me with it since i been trying to find a solution for it for over an hour now..
Rasmus