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

Round Up

Status
Not open for further replies.

VoIPgirl

ISP
Apr 27, 2004
141
US
I am trying to use the Round function...

I put Round([FieldName],4)

Data looks like so...
0.00185
0.00555

I need it to end with 0.0019, however I keep getting 0.0018.. Any suggestions?

data type is text... I tried to update it to a new column with long integer data type, but it sends back 0 all the time.

Thanks
 
You may try this:
Int(10000*[FieldName]+0.5)/10000
Or this:
Format([FieldName],"0.0000")+0

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks so much!! The first suggestion worked perfectly!
I appreciate it. Hope you had a great Turkey Day!
 
Ah, a festive day for you ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV--Last Thursday of November is a national holiday (Thanksgiving) in the U.S. Maybe you noticed way fewer posts Thursday and Friday. Many companies give employees Friday off as well.
 
Thanks GingerR for the note.
In France we don't have this holiday.
 

For background information in VB/VBA the Round function, (and CByte,CInt,CLng and CCur)use something called bankers rounding. If the number part causing the rounding is exactly 5 then the rounding is to the nearest even number

.00555 will be .0056
.00175 will be .0018
also .00185 will be .0018

To do conventional rounding you need your own function as suggest by PHV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top