Android Question Show Leading Zero

peggjones

Active Member
Licensed User
Longtime User
I need to be able to write a variable to a text file with leading zeros. For example if a variable has a value of 10 I want to write out 00010. The value on the file must always be 5 digits long.

Anyone have any ideas other than testing the value and prefixing the value with the required number of zeros.

Many thanks.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I need to be able to write a variable to a text file with leading zeros. For example if a variable has a value of 10 I want to write out 00010. The value on the file must always be 5 digits long.

Anyone have any ideas other than testing the value and prefixing the value with the required number of zeros.

Many thanks.

NumberFormat(1, 3 ,0)) = '"001"
 
Upvote 0
Top