Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The 10 multiple immediately higher than a number
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01492886
Message ID:
01493015
Views:
85
>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
________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform