Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rounding off decimals for invoice
Message
De
30/08/2000 16:30:04
 
 
À
30/08/2000 16:17:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00410992
Message ID:
00411006
Vues:
13
>How do I show only 2dp on a currency field on a report?
>It is for an invoice and so any rounding must be down, and never up.

You can use FLOOR(MTON(yValue * 100))/100 - MTON() coverts a currency expression to numeric, multiply by 100, FLOOR() returns the nearest integer equal to or less than the numeric expression, divide by 100 to convert back to a decimal.

If you want to seek 0 rather than return the next lowest value, INT() truncates the decimal fraction rather than returning the next lower value - significantly different for negative numbers.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform