Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounded values
Message
From
30/12/1998 07:32:41
 
 
To
30/12/1998 06:41:20
Marcelo Codino
Mystic & Faith - Sistemas -
Buenos Aires, Argentina
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00171475
Message ID:
00171480
Views:
35
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform