HTBasic Help
×
Menu
Index

DVAL$

Converts a number to a binary, octal, decimal or hexadecimal string.
 
 DVAL$( whole-number, radix )
 
Usage:
Hex$=DVAL$(Number,Sixteen)
PRINT DVAL$(Quantity,8)
 
Example: DVAL$.BAS
 
Description:
DVAL$ converts a number to a string represented in binary, octal, decimal or hexadecimal, whereas VAL$ always expresses numbers in decimal form.
 
Whole-number contains the number to be converted which must be in the range of a 32 bit two's complement integer, -2,147,483,648 through 2,147,483,647. Radix must be either 2, 8, 10 or 16.
 
The converted numbers have leading zeros as necessary to fill unused digit positions. A minus sign is only produced for decimal numbers. The range of numbers produced is the same as those accepted by DVAL.
 
See Also: