How can I convert a binary string, such as 1001101 to Decimal? (77)
views:
173answers:
2
+15
A:
The Convert.ToInt32 method has an overload that accepts a base parameter.
Convert.ToInt32("1001101", 2).ToString();
SLaks
2009-12-25 17:58:09
+3
A:
Take a look at this questions which is very similar but dealing with hex http://stackoverflow.com/questions/74148/how-to-convert-numbers-between-hex-and-decimal-in-c
Convert.ToInt64(value, 2)
John Duff
2009-12-25 17:59:26