Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rounding
Message
De
27/09/2006 22:11:55
 
 
À
21/09/2006 05:35:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01155844
Message ID:
01157731
Vues:
17
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform