Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The simplest way to convert a number?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00575272
Message ID:
00575274
Vues:
26
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everyone,
>
>I'd like to convert numbers to the following:
>
>5->5
>52->50
>333->300
>4567->5000
>1234567->1000000, e.g. to the round number.
>
>What would be the simplest algorithm for this?
>
>Thanks in advance.

Try:

lnvar = 5
round(lnvar,-1*(len(transform(lnvar))-1))

It appears to work.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform