Need decimal places in calculation

jmccullough

Registered User.
Local time
Today, 08:57
Joined
Jul 30, 2007
Messages
24
I need to calculate the number of days divided by 180 times the number of Units and have it return a number with 7 decimal places. My calculation keeps dropping the decimal places.

As an example, I have two (2) fields in my table:

Field Name Data Type Field Size
Units Number Double
Days Number Double

For my example I will use the following:

122 days 9 Units

My calculation in my query is (122/180)*9 it returns 6.1 and I need it to return 6.0999993

I hope this makes sense. Using access 2010. What am I doing wrong? Any help please.
 
I don't know if that's possible, considering that (122/180)*9 actually equals exactly 6.1
 
Thank you both for the quick reply. I guess I will try and convert as string and try formatting the field.

Can someone tell me why though when you perform the calculation on a calculator it displays as: 6.0999993, just curious.

(122/180)*9 = 6.0999993

Thanks for your help again.
 
Did someone just ask for a math lesson? Put me in coach.

On some calculators you will get 6.0999993 for the same reason 2/3 has its last decimal digit as a 7 (e.g. .666667)--it has a limited precision. Better yet, that limitation is handled differently by the display than by the memory of a calculator.

In your calculation when you do the first operation (122/180) the display rounds the result to something like .6777778, but the memory of the caclulator stores it by truncating it like .67777777. So when you do the next operation (*9) you get 6.0999993 even though .6777778*9 should come out to 6.100001
 

Users who are viewing this thread

Back
Top Bottom