Using Decimals

G

Guest

I have been advised to use currency as a field type when using decimals. When
I try to use the data I am getting wrong data.
Example Field "Tolerance" set to currency.
Data Stored "$0.50"
Variable "Dim SinglePackTolerance As Double"
Data picked up as "0.05"

I have tried using "Dim SinglePackTolerance As Currency"
"Dim SinglePackTolerance As Single" "Dim SinglePackTolerance As Integer" all
have given wrong result.

I want to use .50 to multiply another number and .05 is giving me the wrong
answer.

I have other fields in the same table set to currency and the information is
being picked up correctly.
$15.40 picked up as 15.4
$0.74 picke up as 0.74


Should I be using currency for what I am trying to do?

Do I need to format the table field differently?

I thank you in advance for your help.

Allan
 
J

Joseph Meehan

AHopper said:
I have been advised to use currency as a field type when using decimals.

I am not sure why someone suggested that.

I am not sure what your question is so I can't really answer it, but I
will make a couple of notes that are often not understood and may be causing
some confusion.

The number displayed may not be the original number. For example the
number 1.28456 may be displayed as one decimal and it will show 1.2, not 1.3
If that displayed number 1.2 is added to another number 1.22000 (which
would also be displayed as 1.2) the result is going to be 2.5.

Rounding when done can be done several ways and give different answers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top