Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rounded values
Message
De
30/12/1998 07:32:41
 
 
À
30/12/1998 06:41:20
Marcelo Codino
Mystic & Faith - Sistemas -
Buenos Aires, Argentine
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00171475
Message ID:
00171480
Vues:
36
>I´ve this expression :ALLT(STR(ROUND(VAL(TRANSFORM(n_val,'99999.99')),2))).The result is a number without decimals,but I want that decimals appears rounded like this : Eg.:12.93 = 12.95,2450.22 = 2450.20 and so on.How can I do this ?

If you want to round to any number (for example, 0.05) you can use:
FUNCTION SpecialRound
LPARAMETERS nValue,nRoundTo
RETURN nRoundTo*ROUND(nValue/nRoundTo,0)
ENDFUNC
PS. Why VAL(TRANSFORM(...))? It seems redundant to me.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform