Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The 10 multiple immediately higher than a number
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01492886
Message ID:
01493015
Vues:
86
>How to find the 10 multiple immediately higher then a number.
>
>e.g.
>
>2 ---------- 10
>15----------20
>17----------20
>21----------30
>41----------50
>
>Seems simple but I cannot imagine a function to do it.

My functions:
? REPLICATE([-],36)
? RoundPlus(2,1) 
? RoundPlus(15,1) 
? RoundPlus(17,1) 
? RoundPlus(21,1) 
? RoundPlus(41,1) 
? REPLICATE([-],36)
? RoundMinus(2,1) 
? RoundMinus(15,1) 
? RoundMinus(17,1) 
? RoundMinus(21,1) 
? RoundMinus(41,1) 
? REPLICATE([-],36)

FUNCTION RoundPlus(tnNum, tnPos) 
  RETURN CEILING(tnNum/10^tnPos)*10^tnPos 
ENDFUNC 

FUNCTION RoundMinus(tnNum, tnPos) 
  RETURN FLOOR(tnNum/10^tnPos)*10^tnPos 
ENDFUNC 
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform