Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding when .6 or higher?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00709236
Message ID:
00709260
Views:
25
>Is there a way to round up only if the digit is 6 rather than 5? I know this is not conventional rounding, but we would like:
>
>1.055 - rounded to 1.05
>1.056 - rounded to 1.06
>

Try
INT(100 * (nVar+.0049999))/100
or
FLOOR(100 * (nVar+.004)/100
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