Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Currency & Decimals
Message
De
07/10/2002 20:07:15
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00708564
Message ID:
00708570
Vues:
10
>Hi
>
>On my report I have an invoice amount field. I put it on my report and it displays fine.
>
>I set the format to currency and all of a sudden I have copious quantities of decimal places displaying. What gives. Since when did the standard currency display need more decimals than two.
>
>I tried using
>
>
set decimals to 2
>
>but to no avail.

Did you change the field type to Currency (Y)? If so, the data is stored as a BCD quantity with 4 decimal places; you need to alter the mask on the report form's field references, or convert the field to a Numeric for output using MTON(); Numerics respect the SET DECIMAL settings.

Currency fields and variables have a nasty habit; if there is even a single Currency datatype in an expression, the type of the result of the expression becomes a Currency type. This can result in subtle rounding problems on multiplication, division and transcendental operations, different from those experienced by type N expressions. there are distinctive advantages to currency datatypes in addition and subtraction operations involving very large or very small quantities because of the BCD representation - the same advantages accrue to other math operations AS LONG AS NO INTERMEDIATE OR FINAL RESULT HAS > 4 DECIMAL PLACES OF PRECISION.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform