Integer to Binary in C#

May 18 2009 3:29 PM

Hello,

I am converting an integer to binary in C#; I am currently using the following:

b_Chrom[z].set1 = Convert.ToString(NextGen[z].set1, 2);

NextGen[z].set1 holds the integer value which can range from 0 to 30.  The conversion can range from a 1 to 5 character string.  The process works but I have the additional need for all of the resulting string conversions to be the same lenght, 5.

b_Chrom and NextGen are both structures.

Any suggestions?

Thank you,

Rod