Hi there,
Currently I have a int variable which can be of varying size 14,15,16
and I want to construct a
String variable of size 20.
I am using java.text.NumberFormat and DecimalFormat classes for the same
So accordingly there should be 6 preceding zeros in case length is 14,
5 preceding zeros when length is 15 and 4 preceding zeros when length is 16.
Currently I have a static number format something like this
NumberFormat numberFormat = new DecimalFormat("00000");
how can i make it more generic where I can specify the total length of the
String and adjust the preceding zeros accordingly
Regards,