Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rounding
Message
De
21/09/2006 08:02:05
 
 
À
21/09/2006 07:27:10
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:
01155898
Vues:
15
>>Hi guys
>>
>>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.
>>
>>
>>Fred
>
>
>? INT(18571.47/10)*10
>? ROUND(18571.47/10,0)*10
>? CEILING(18571.47/10)*10
>
>? INT(18571.47/0.05)*0.05
>? ROUND(18571.47/0.05,0)*0.05
>? CEILING(18571.47/0.05)*0.05
>
Ceiling() is not a good choice if the numbers can be negative
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform