hi, how to convert a real4 value to a string? i tried wsprintf and %i as format but it doesnt work. has anybody an idea? tnx
Posted on 2000-12-14 12:42:00 by [SaFc0n]
there should be a fptoa proc in Masm32lib but i'm not sure if it is for REAL4 or REAL8. Btw, why doesn't wsprintf support %f as printf ??
Posted on 2000-12-14 12:58:00 by (scalp)
I suspect it's because when the function was first created, FP was not standard equipment, and MS had at least two FP formats. If you're working with HLLs, you already have equivalent or similar formatting features. So perhaps that's why it hasn't been upgraded.
Posted on 2000-12-14 20:59:00 by ub1
What about something like this for using wsprintf: .386 .model flat, stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\user32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib .const input dq -999999431.0999999 format db "%d.%06d",0 trun dw 1F32h x dd 1000000 .data? _int dd ? ;better if this was a QWORD _frac dd ? output db 24 dup(?) .code start: finit fldcw trun fld input frndint fistp _int fld input fisub _int fimul x fabs fistp _frac Invoke wsprintf,Addr output,Addr format,_int,_frac Invoke MessageBox,NULL,Addr output,NULL,MB_OK Invoke ExitProcess,NULL end start
Posted on 2000-12-17 00:54:00 by Larrry