Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding
Message
From
27/09/2006 22:11:55
 
 
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:
01157731
Views:
15
Jambo Fred, you can create a function like :
FUNCTION RNDU(R)
	N = 10 && round up to 10c
         * N = 5 && round up to 5c
	R = ROUND(R * 100,0)
	
	IF (R%N) = 0
		R = R - (R%N)        
		*//(R%N)=1,2,3,4
	ELSE
		IF (R%N) >4  && if 1 to 4 cents, round down to 0
			R = (R - (R%N))+N   
		ELSE     && if 5 to 9 cents, round up
			R = (R - (R%N)) 
		endif	     
		*//(R%N)=1,2,3,4
	ENDIF
	R = R/100
RETURN R
Hope this helps.
Previous
Reply
Map
View

Click here to load this message in the networking platform