How to convert Decimal to binary C# (4 bits) -
How to convert Decimal to binary C# (4 bits) -
this question has reply here:
byte binary string c# - display 8 digits 3 answersi want convert decimal numbers binary, i'm using way
private string strtobin(string input) { int number = convert.toint32(input) ; string res = convert.tostring(number, 2); homecoming res; }
it's working when i'm having illustration "6" i'm getting 110 instead of 0110? tips?!
simple string modification:
string res = convert.tostring(number, 2); res = new string('0', 8 - res.length) + res;
c# binary decimal
Comments
Post a Comment