1
1
Fork 0
mirror of https://github.com/DualBrain/QB64.git synced 2023-11-19 13:10:13 +00:00
QB64-website/wiki/CVSMBF.md
2022-12-24 19:12:43 -06:00

1.5 KiB

The CVDMBF function decodes a 4-byte STRING generated by MKSMBF$ (or read from a file) to SINGLE numeric values.

Syntax

result! = CVSMBF(stringData$)

Description

Example(s)

Showcases the reduced space to store an encoded number.


a! = 700.2213
PRINT "Value of a!:"; a!
b$ = MKSMBF$(a!)
PRINT "Value of a! encoded using MKSMBF$: "; b$
PRINT "The string above, decoded using CVSMBF:"; CVDMBF(b$)


Value of a!: 700.2213
Value of a# encoded using MKSMBF$: *♫/è
The string above, decoded using CVSMBF: 700.2213

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

See Also