Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this not irritating?
Message
From
06/03/2006 09:57:01
 
 
To
06/03/2006 08:42:51
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01101592
Message ID:
01101715
Views:
9
>I think so it's not an important bug. because there is a workaround. I found this error in fpd26, but I could find a workaround so I didn't reported it:
>
>?transform(roun(xnum,2),"999,999,999.99") &&--- sometimes it gives strange ascii characters with some numeric values
>

>
>xnum2=roun(xnum,2)
>?transform(xnum2,"999,999,999.99") &&--- workaround
>
>a second (again fpdos),
>-when set decimal to 5
>-and fields has decimal 2 after point
>
>sometimes I doing some numeric processes with fields (* and /)
>foxpro dos hangs up. I use round(...,2) and fpd don't hangs up than anymore.
>
>

this is not a workaround.

the problem is this:
- print a numeric variable,
with N > SET("decimals") decimals
and format 999,999.9...M...9 with M > SET("decimals")

example:
clear
set decimal to 3

nvar=9999.9995
cFormat ="9,999.99999"
***********************************
* here you don't known nvar and cFormat values
? transform(nvar,"@R "+cFormat) && wanted 9,999.99950

* workaround
? PrintNumber ( nvar , cFormat  )

nvar=9999.999585
? transform(nvar,"@R "+cFormat) && wanted 9,999.99959

? PrintNumber ( nvar , cFormat  )

PROCEDURE PrintNumber ( n , format )
nSetDec = SET("Decimals")
SET DECIMALS TO LEN(JUSTEXT(m.cFormat ))
cRet= transform(ROUND(nvar,SET("Decimals")),"@R "+cFormat) && wanted 9,999.99950
SET DECIMALS TO m.nSetDec
RETURN m.cRet
Previous
Reply
Map
View

Click here to load this message in the networking platform