How to specify format of number

Dear all,

I have excel sheet which contains some card number. It start from 1 upto 9999.
But other system needs to recognize those number as 8 length fixed number. 000001 - 009999.

If I read the excel date, the number was converted to 1 - 9999.
Is there any method to output the number as 000001 - 009999 ?

Thank you very much.

Hi,
I hope this will helpful to You…

one.ToString(“D3”)

Input is 1…
Ouput is 001…

Regards,

2 Likes

add single quote(') to the number then write to the excel, like '000001 and '0099999

hello @Kn.opp use this excel function =Text(A1,“00000000”) this will add single quote at starting just like @ddrdushy1 said. Useful if there are mutliple rows.

1 Like

sorry misunderstand, to change 1 to 00000001 use below code
Integer.parse(“1”).toString(“00000000”)

1 Like

Thanks Hemanth,

It helps me a lot! Thank you very much!

ddrdushy1
Thank you very much for your help on this!!!