How do I convert number to base 10 from another base?
Category: System, viewed: 563 time(s).
In this example you'll see how to convert number from another base such as binary (base 2), octal (base 8) and hexadecimal (base 16) into the corresponding decimal (base 10) value.
The Convert.ToInt32(String value, int base) overloaded method take a string value representing a number and an integer representing the base of the number. This method then convert the numeric string into an integer and return this number as a base 10 value.
This class also have another method such as Convert.ToByte, Convert.ToDouble, Convert.ToInt64, etc. And below in a result produced by the example above.
Binary 10 = 2 decimal Octal 77 = 63 decimal Hexa 9AFF = 39679 decimal
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!