Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning the number of decimals a field has
Message
De
14/08/2003 11:44:22
 
 
À
14/08/2003 10:40:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00820138
Message ID:
00820169
Vues:
22
This message has been marked as a message which has helped to the initial question of the thread.
>Is there a function that will return how many decimal places a numberic field has? Something like LEN() for a character field. I know I can get it with AFIELDS but I only want to check one field and this returns all the fields then I need to find what the field number is in the array. Seems like a pain for something this simple.
Function DecCount(tnVal)
Local n
cVal = Alltrim(Padl(tnVal, 1000))

Return Len(cVal - IIF(At('.', cVal) = 0, Len(cVal), At('.', cVal))

? DecCount(AliasName.FieldName)
Alan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform