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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only leave 4 digins after the point

Status
Not open for further replies.

WelshyWizard

IS-IT--Management
Apr 23, 2006
89
GB
I'm looking to take a value, for example 9383.121459 and change the value to 9383.1214 (for digits after the point)

I don't want to round the value to 4 decimal places, just simply cut off the digits after the the 4th digit.

Also, not all values will have the same number of digits to start... For example the value couls be 12, 12.343, 12.2 etc....

Any one have any ideas?!

Cheers

Today is the tomorrow you worried about yesterday - and all is well.....
 
Something like this ?
NewVal = Int(10000 * OldVal) / 10000

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Also..

Code:
=ROUNDDOWN(A1,4)

-----------
Regards,
Zack Barresse
 
=ROUNDDOWN(A1,4)
How do you use this in VBA ? ;-)
 
Hehe, sorry..

Code:
WorksheetFunction.RoundDown(Workbooks("Book1.xls").Sheets("Sheet1").Range("A1"), 4)

Of course, depending on your situation should dictate how you need to reference the workbook/worksheet.

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top