QB Sample Function to Convert from Floating-Point to String (63095)
This article was previously published under Q63095
SUMMARY
This article provides a code example of a FUNCTION procedure that
always returns the string equivalent of a real number in the format
"WholeNumber.Fraction". This works around the usual behavior of the
STR$ function, which, depending on how a real number is represented in
binary, returns either a string in the form of "WholeNumber.Fraction"
or a string in scientific notation.
This information applies to Microsoft QuickBasic versions 4.00, 4.00b,
and 4.50, to Microsoft Basic Compiler versions 6.00 and 6.00b for
MS-DOS and MS OS/2, and to Microsoft Basic Professional Development
System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2.
Modification Type: |
Minor |
Last Reviewed: |
1/9/2003 |
Keywords: |
KB63095 |
|