Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Currency field with 4 decimals in report
Message
From
14/06/2023 00:23:22
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
13/06/2023 12:36:29
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01686730
Message ID:
01686737
Views:
54
>>>>>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.

ACK
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform