How can i convert the following?
- Decimal to Hexadecimal
- Decimal to Octal
- Hexadecimal to Decimal
- Octal to Decimal
Printable View
How can i convert the following?
- Decimal to Hexadecimal
- Decimal to Octal
- Hexadecimal to Decimal
- Octal to Decimal
Does this help?
http://www.learn-programming.za.net/...binhexoct.html
Ok i dont understand the conversion from decimal to hex, can anyone explain? (nevermind, i get it now)Quote:
Originally Posted by manavo11
I want to convert contents of a text box from decimal to binary... how do i do this?
First convert the string to numeric data type. (Long)
Then see post#3 of this very old thread.
Also, for VB.NET see this this thread.
For working with ONLY small numbers see this thread.
ABC (base 16) to base 10 = (12 * 16^0) + (11 * 16^1) + (10 * 16^2) = 2748
2748 (base 10) to base 16
= 2748 / 16 = 171 remainder 12
= 171 / 16 = 10 remainder 11
= 10 / 16 = 0 remainder 10
Convert the remainders into the proper letters and place them bottom to top.
10, 11, 12 = ABC
This conversion works fine in any scenerio. Just replace the 16 with whatever base you want. You must use ints however, double precision division will corrupt this.
thx all got it sorted!