Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining field format in a table
Message
 
 
À
14/09/2011 14:19:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01523528
Message ID:
01523531
Vues:
43
>How can I determine the field definition in a table that is format, and then use that in a Transform() function.
>
>Example: a field as N(5,2)
>
>What I ultimately want achieve is getting a string version that field that is formatted to the same number of decimals.
>
>Example, if the field is defined as N(5,2) and the values is 2.50, I want as string that reads “2.50”, if the value is 1.00, I want a string that is ”1.00”. But I cannot hard-code the number of decimals, it must come from the field definitions in the tables.
>
>If it is an integer, then it will not have any decimals.
>
>I must use the field data to determine the format of the string that I want to show in some html page I am building.
>
>Right now, when I use the Transfrom() function, it will omit the decimals if the value is a whole number.
>
>Transform(1.00) returns “1”, but I want “1.00”

AFIELDS function returns all necessary information about the field.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform