Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Format mask for numbers
Message
 
À
02/12/2008 20:16:21
Yh Yau
Ingenuity Microsystems Sdn Bhd
Kuala Lumpur, Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01365281
Message ID:
01365348
Vues:
14
>I have a need to display a numeric field on the report with options to have no decimals, 2 decimals, 3 decimals or more.
>Currently I'm using the format mask in the field expression to do this but unable to put a iif() condition on the format mask to dynamically change the format mask based on a public variable to decide on how many decimal points the format mask should have.
>
>Is there a way to do this?
>
>Thanks in advance.
>Yau

Change the report field expression to be character and delete the format expression. Instead, set the field expression to something like this:

TRANSFORM(YourNumber, ICASE(FirstCondition=.t., '999.999', SecondCondition=.t., '9999.99', ThirdCondition=.t., '99999.9', '999999'))
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform