How to convert string to int and save zero in the begining

I am parsing excel file and I have one string column of zip codes, I wanna convert it into integers,
for example, I have fields “17845” and “04745” and the output that I want is 17845 and 04745 but when I use strconv.ParseInt the out put is 17845 4745

1 Like

You can’t because int is a number and not a string. But you can get output with fixed wide format.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.