Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formating display of floating point numbers
Message
De
08/08/2011 19:49:09
 
 
À
08/08/2011 18:15:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01520460
Message ID:
01520469
Vues:
64
>I have *lots* of fields that are B(16)
>
>If I want to display that number rounded to the fourth decimal, for example, in a textbox what are my options for formatting the display ( assuming not just creating a dummy display field and converting the number )
>
>Seems there should be an easy trick to it, but I'm not seeing a format that looks right and I can't use an input mask for display - or can I ?
>
>This is bound data ( albeit bound through VFE field objects so I do have some wiggle room in formatting before I display if I can just figure out what I want to tell it.
>
>So, I have 008900098080.98090000000 and I just want to see 8900098080.9809 or even expressing in millions 8900.1

I created a simple base VFP form with a base text box and bound a B(16) cursor column to the text box. By default, leading zeroes are always trimmed. If you want comma separators and 4 decimals you can set .InputMask to something like 999,999,999,999,999.9999 - extra leading 9s and commas are not shown.

I don't know how you'd display millions, you might have to go to an unbound text box and control the output display/format yourself, unless VFE gives you something.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform