static private void append ( StringBuilder tgt , String pfx , int dgt , long val ) { tgt . append ( pfx ) ; if ( dgt > 1 ) { int pad = ( dgt - 1 ) ; for ( long xa = val ; xa > 9 && pad > 0 ; xa /= 10 ) { pad -- ; } for ( int xa = 0 ; xa < pad ; xa ++ ) { tgt . append ( ' ' ) ; } } tgt . append ( val ) ; }
Append a right - aligned and zero - padded numeric value to a StringBuilder .