Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing decimal places 2

Status
Not open for further replies.

JamesLynch

Technical User
Oct 30, 2002
11
GB
After building an expression to work out a percentage value I am left with a figure like 4.22225645.

How can I cut the decimal places down to just one of two figures. Even Better can I round the value up and Down.

Thanks
James
 
if it is for printing or showing on a report, use the Format$ function or set a textbox's format (look in the help for the keyword
Code:
Format
)

Best regards
 
use Cint() to convert to closest whole number;

Clng() if the || value is greater than 32,000 (absolute value)

or you can convert to currency, that'll automatically convert to 2 decimal places (i think)

if you don't like that.. you could always write your own function..









Cruz'n and Booz'n always.
This post shows what little I do at work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top