static String zeroPrepend ( long num , int digits ) { String numStr = Long . toString ( num ) ; if ( numStr . length ( ) >= digits ) { return numStr ; } else { return String . format ( "%0" + digits + "d" , num ) ; } }
Return the string prepended with 0s .