Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Currency field with 4 decimals in report
Message
De
13/06/2023 12:36:29
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
13/06/2023 09:28:53
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01686730
Message ID:
01686734
Vues:
50
>>>>Hello all,
>>>>
>>>>In my report I have currency fields. There are 4 decimals for those fields. How can I have only two decimals?
>>>>
>>>>Thanks in advance.
>>>
>>>#1 is this CURRENCY as field type or just a number with four decimals?
>>>#2 Try to format it. The report field edit form offer fields for this. Format expression like 999999.99. See Format Expressions for Field Controls in vfp help. Check if the result is as expected (problems with rounding?)
>>
>>Use round(myCurrencyField,2) as the expression, in that case.
>
>As for currency, ROUND() might be wrong. Book-keeping is not engineers maths. This is more CEILING. Why I wrote check
>
>Update:
>Aside where to round and sum.

I did hit that wall back in 1990. Morale of the story: keep the numbers in the format that accountants keep them. Never calculate anything twice. Store rounded. For percentage of the total, don't calculate it, sum the individual values of the percentage applied to each line item. It's less correct, but it adds up.

The reason that currency fields have four decimals is not the currency values themselves, it's for exchange rates.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform