How-To... - Convert Decimal to Hexadecimal and Octal

Converting Decimal to Hex or Octal is much simplier than converting to Binary. Visual Basic has two Functions - Hex() and Oct() - suprisingly. The syntax is as follows:-

Hex(number)
Oct(number)

In this example, the contents of txtDecimal is used and the final answer is printed into txtAnswer. No source-code available on this page, but you can download the project file by clicking here.


This site is Copyright © 1999 of David Cowan. VB How-To, Dodgesoft and DodgeSoft Productions is Copyright © 1999 of David Cowan. Source-code and programs are copyright of their respective owners. For a messageboard, click here