Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding off decimals for invoice
Message
From
30/08/2000 16:30:04
 
 
To
30/08/2000 16:17:51
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00410992
Message ID:
00411006
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform