Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a function to strip off zero-filled decimals
Message
From
18/08/2000 16:26:49
 
 
To
18/08/2000 16:12:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00406732
Message ID:
00406882
Views:
39
>>If it came from a table originally, you may have to get the decimals at that point and keep track of it.
>
>Alright, how do I do THAT? I don't mean to sound like a dunce, but between three developers in my shop, we can't figure this one out.
>
>Bill

If it came from a table, use AFIELDS() to get the fields, then find the field in the resulting array.
The decimals are the 4th column. e.g.
SELECT mytable
lnVariable = mytable.nfield
AFIELDS(laFields)
lnRow = CEILING(ASCAN(laFields,"nfield")/16)
lnDecimals = laFields[lnRow,4]
How to keep track of it is another thing, depending on the life of the value - does it get passed around to other processes, does it stay in one process, etc.

If I may ask, why do you need this and why can you not change the DECIMALS setting? I only ask, because there are multiple ways to get the same results for just about everything in VFP.
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform