QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The CVDMBF function decodes an 8-byte STRING generated by MKDMBF$ (or read from a file) to DOUBLE numeric values.

Syntax

result# = CVDMBF(stringData$)

Description

Example(s)

Showcases the reduced space to store an encoded number.


a# = 77000.24523213
PRINT "Value of a#:"; a#
b$ = MKDMBF$(a#)
PRINT "Value of a# encoded using MKDMBF$: "; b$
PRINT "The string above, decoded using CVDMBF:"; CVDMBF(b$)


Value of a#: 77000.24523213

Value of a# encoded using MKDmbf$:  5─c▼d▬æ

The string above, decoded using CVDMBF: 77000.24523213

Since the representation of a double-precision number can use up to 15 ASCII characters (fifteen bytes), writing to a file using MKDMBF$ conversion, and then reading back with the CVDMBF conversion can save up to 7 bytes of storage space.

See Also