Hi
I need to know how to display a real number up to 5 digits to the right of decimal point.
Thanks
Hello,
Here is the answer and all you need to make it
http://www.masm32.com/board/index.php?topic=8022.msg58718#msg58718
Hi ToutEnMasm,
I downloaded strsafe.zip and strsafeinc.zip.
How do I use them in MASM?
You could also use the FpuFLtoA function from the Fpu.lib (which comes with MASM32) to convert your real number to ASCII. If you do, PLEASE read the HELP file which comes with the library.
Quote
I downloaded strsafe.zip and strsafeinc.zip.
How do I use them in MASM?
Put the .inc in the \masm32\include directorie ,the lib in \masm32\lib as the others.
In your source:
Quote
include \masm32\include\strsafe.inc
includelib \masm32\lib\strsafe.lib
and then you can call the functions exactly as the sample show you.
Thanks ToutEnMasm!
Hi ToutEnMasm,
Which functions do I call for displaying the real or floating point precision
by using the strsafe.inc and strsafe.lib?
Please reply soon
Thanks
etow,
You can not do it with only strsafe.inc and strsafe.lib, those functions only display strings. You need to use sprintf or FpuFLtoA to convert the floating-point variables to a string first. Another method is to use printf.
Quote from: etow on January 30, 2008, 12:27:14 PM
Hi
I need to know how to display a real number up to 5 digits to the right of decimal point.
Thanks
msvcrt.dll contains sprintf which can convert doubles to strings...
mov eax, offset double
invoke sprintf,offset buffer,"%#0.5f",[eax],[eax+4]
add esp,16
Thanks Donkey