473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

.1 + .9 = .999999977648258

I have values in a table that are represented on a form and subform. The values are numbers (typically 1, or .5, or .25, or .9, or .1, etc...).

I want to add all occurrences from the table as displayed on the subform and display them on my main form. I am able to do, however, when the values of .1 and .9 are summed, they equal .999999977648258.

This is the data control source I am using to sum the number in my text box:
=Sum(nz([Sep]))

And this is the data control source I am using to display that sum from the subform on my main form:
=[Resource Allocations Subform].Form!SumSep

Why does Access think .1 + .9 = .999999977648258?

Thanks!

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
2 1076
On Wed, 05 Jan 2005 01:27:03 GMT, "John Russell via AccessMonster.com"
<fo***@AccessMonster.com> wrote:
I have values in a table that are represented on a form and subform. The values are numbers (typically 1, or .5, or .25, or .9, or .1, etc...).

I want to add all occurrences from the table as displayed on the subform and display them on my main form. I am able to do, however, when the values of .1 and .9 are summed, they equal .999999977648258.

This is the data control source I am using to sum the number in my text box:
=Sum(nz([Sep]))

And this is the data control source I am using to display that sum from the subform on my main form:
=[Resource Allocations Subform].Form!SumSep

Why does Access think .1 + .9 = .999999977648258?


Because it's doing the math using the Double type which is a Binary, not
Decimal floating point numbering system. You can use the Round function to
clean up the result.
Nov 13 '05 #2
Steve Jorgensen wrote:
On Wed, 05 Jan 2005 01:27:03 GMT, "John Russell via AccessMonster.com"
<fo***@AccessMonster.com> wrote:

I have values in a table that are represented on a form and subform. The values are numbers (typically 1, or .5, or .25, or .9, or .1, etc...).

I want to add all occurrences from the table as displayed on the subform and display them on my main form. I am able to do, however, when the values of .1 and .9 are summed, they equal .999999977648258.

This is the data control source I am using to sum the number in my text box:
=Sum(nz([Sep]))

And this is the data control source I am using to display that sum from the subform on my main form:
=[Resource Allocations Subform].Form!SumSep

Why does Access think .1 + .9 = .999999977648258?

Because it's doing the math using the Double type which is a Binary, not
Decimal floating point numbering system. You can use the Round function to
clean up the result.


Or use a scaled integer, e.g. Currency (or decimal if your version has
it) as these are accurate... for decimal use anyways, still can't do 1/3 :-)

--
This sig left intentionally blank
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.