[RESOLVED] Different Number Bases
I know that I can convert from decimal to octal using the Oct() function and from decimal to hexadecimal using the Hex() function...
But how do I convert from Octal to Decimal, Hexadecimal to Decimal, Binary to Decimal and from decimal to binary???
Also... how do I switch the number mode to hexadecimal if I wish to perform calculations in hexadecimal... or binary... or octal...
Any help would be appreciated...
Thanks in advance
Re: Different Number Bases
To convert from Hex to Dec you can use the Val function, eg:
Code:
decvariable = val("&H" & hexvariable)
To convert from Octal, change the &H to &O
As to performing calculations in hex etc, that is irrelevant - the answers will be the same no matter what base you are using, eg:
Decimal
2 * 10 = 20
Hex
&H2 * &HA = &H14
(&H2 = decimal 2, &HA = 10, &H14 = 20)
Re: Different Number Bases
Thanx a lot si... you make perfect sense...