Using Numbers and decimals

A

Abe Katz

Hello,
I have a Control Named Qty, I set the Field Size to Single, Decimal Places
to Auto.
I want to use the control with whole numbers only or with decimals. i.e. 8
or 8.33
The problem is, in the Totals query when I use the sum function, the query
will display the Qty as 8.329999.
This is how I would like to display the Qty on the query, form and report.
8 should be 8 only (no decimals or zeroes)
8.33 should be 8.33
Thanks in advance
Abe
 
J

Jeff Boyce

Abe

I'm a bit puzzled ... in my world, [Qty] is an abbreviation for "quantity".

How can a quantity (i.e., a count of physical objects) be a "Single" data
type? What does it mean to have 8.33 of something?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

Hello,
I have a Control Named Qty, I set the Field Size to Single, Decimal Places
to Auto.
I want to use the control with whole numbers only or with decimals. i.e. 8
or 8.33
The problem is, in the Totals query when I use the sum function, the query
will display the Qty as 8.329999.
This is how I would like to display the Qty on the query, form and report.
8 should be 8 only (no decimals or zeroes)
8.33 should be 8.33
Thanks in advance
Abe

Single and Double are "Floating Point" numbers. They're actually stored as a
binary number, which is an *approximation* - accurate to about 7 decimal
places (24 bits) for Single and 14 decimals (48 bits) for Double.

Just as a number like 1/7 cannot be depicted exactly as a decimal number (it's
0.142856142856142856.... ), a number like 8.33 cannot be depicted exactly as a
floating point number.

If you want four or fewer decimal places you can use a Currency datatype (not
the format; use Currency instead of Number as the datatype in the table design
window). If you need more, you can use a Decimal datatype - specify the total
number of digits in the Precision property and the number of digits after the
decimal in Scale. These datatypes will not have the roundoff error.
 
V

Volker Neurath

Jeff said:
How can a quantity (i.e., a count of physical objects) be a "Single" data
type? What does it mean to have 8.33 of something?

For instance 8.33 litres of a fluid?

Or 8.33 metres e.g. of a piece of wood, metal ?

Volker
 
A

Abe Katz

I'm sorry for the confusion. If I have 10 boxes with 6 pieces in a box = 60,
and I take out 8 pcs, I'm left with 8.67 BoxQty.

Jeff Boyce said:
Abe

I'm a bit puzzled ... in my world, [Qty] is an abbreviation for
"quantity".

How can a quantity (i.e., a count of physical objects) be a "Single" data
type? What does it mean to have 8.33 of something?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Abe Katz said:
Hello,
I have a Control Named Qty, I set the Field Size to Single, Decimal
Places to Auto.
I want to use the control with whole numbers only or with decimals. i.e.
8 or 8.33
The problem is, in the Totals query when I use the sum function, the
query will display the Qty as 8.329999.
This is how I would like to display the Qty on the query, form and
report.
8 should be 8 only (no decimals or zeroes)
8.33 should be 8.33
Thanks in advance
Abe
 
J

Jeff Boyce

Thanks for the clarification.

I'd probably disregard the [BoxQty] if I were doing this, since I'll have to
assume that a box of pencils and a box of paper towels can have differing
numbers of items. I'd probably go to the lowest unit of measure and just
use something like [UnitQty]. That way, it doesn't matter how many "boxes"
are involved...

Or maybe for your system, you MUST know the number of boxes?!

Regards

Jeff Boyce
Microsoft Office/Access MVP


Abe Katz said:
I'm sorry for the confusion. If I have 10 boxes with 6 pieces in a box =
60, and I take out 8 pcs, I'm left with 8.67 BoxQty.

Jeff Boyce said:
Abe

I'm a bit puzzled ... in my world, [Qty] is an abbreviation for
"quantity".

How can a quantity (i.e., a count of physical objects) be a "Single" data
type? What does it mean to have 8.33 of something?

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Abe Katz said:
Hello,
I have a Control Named Qty, I set the Field Size to Single, Decimal
Places to Auto.
I want to use the control with whole numbers only or with decimals. i.e.
8 or 8.33
The problem is, in the Totals query when I use the sum function, the
query will display the Qty as 8.329999.
This is how I would like to display the Qty on the query, form and
report.
8 should be 8 only (no decimals or zeroes)
8.33 should be 8.33
Thanks in advance
Abe
 
J

Jeff Boyce

Probably just a difference of semantics...

I'd only use Qty on discrete objects, and Amt on things measuable
continuously...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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