Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding
Message
 
 
To
21/09/2006 05:35:55
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01155844
Message ID:
01156182
Views:
27
Fred,

To round to the left of the decimal point use a negative argument to the round() function.
? round( 123456.78, -1 ) && round to tens
? round( 123456.78, -2 ) && round to hundreds
To get 5 cent rounding you'll have to multiply and divide by 20 like the others have shown.

>Is there an easy way of using the native Rounding function(s) to round like
>
>i) To the Nearest 10 whereby 18571.47 becomes 18580.00 UP and 18570 Down ?
>ii) To the Nearest 5 Cent Where 18571.47 becomes 18571.50 Up and 18571.45 Down
>
>Currently I am using a complex String manipulation function to achieve this.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform