Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The 10 multiple immediately higher than a number
Message
De
17/12/2010 07:03:55
 
 
À
17/12/2010 07:00:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01492886
Message ID:
01493059
Vues:
70
>>>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.
>>
>>Just for variety (and assuming no negative values):
x -MOD(x,10)+10
Works with values other than 10 as well :-}
>
>Another option, that does work with negative numbers, is:
>
>ceiling(x/10)*10
>
Hi,
Think Al already suggested that one ;-}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform