In my web service method, I have an input with type Long
. I should add two zero in the left, so I converted it to String
and I concat the two zero, then I should again converted to Long, I found that the Long type in java ignore left zero. How can I keep left zero in a Long value ?
Long a=58451236;
String b= "00"+String.valueOf(a);
Long c = Long.parseLong(b); // ==> Excepected value : 0058451236, found c= 58451236