Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Round to nearest 5
Message
De
25/01/2005 07:58:14
 
 
À
25/01/2005 07:20:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00980330
Message ID:
00980340
Vues:
24
Jos,

lnNum=87
lnRoundTo=5
?MAX(1, FLOOR(lnNum/lnRoundTo)*lnRoundTo + IIF(MOD(lnNum,lnRoundTo)=>lnRoundTo/2, lnRoundTo, 0))

>Hi All,
>
>Having a bit of a brain freeze here...I have an integer between 0 and 100. I want to round it to the nearest integer wholly divisible by 5 i.e. 0,5,10,15,...95,100
>
>Sorry for the low quality challenge :)
Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform