Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need a function to strip off zero-filled decimals
Message
De
18/08/2000 16:26:49
 
 
À
18/08/2000 16:12:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00406732
Message ID:
00406882
Vues:
40
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform