Access 2007: % fields rounding to nearest integer

S

sandiaman

My Access program is rounding % fields to the nearest integer in the
FormView. Example: .05 rounds down to .00%, while .06 rounds to 100.00%.
This happens even in a new database. I believe there is a default somewhere
in database that I cannot find. How do I get the form NOT to round?
 
J

John Spencer MVP

Change the field type to Double or Currency. Right now you are probably use
Integer or Long (both integer only fields) for the type.n

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

Jerry Whittle

What does the data look like in the table? I'm assuming that the field is set
to an Integer or Long Integer. Both will round to a whole number as integers
don't store decimals. Try setting that field to a Single or Double data type.
 
J

John W. Vinson

My Access program is rounding % fields to the nearest integer in the
FormView. Example: .05 rounds down to .00%, while .06 rounds to 100.00%.
This happens even in a new database. I believe there is a default somewhere
in database that I cannot find. How do I get the form NOT to round?

Open the Table in design view, and select this field. My guess is that its
datatype is Number, Long Integer (look at the field properties). An Integer is
by definition a whole number.

If you change the datatype to Currency you'll get four decimal places (0.05 =
5% of course). You can also use Number... Single, Number... Double, or
Number... Decimal; with the latter you can specify the number of digits of
precision and the scale, e.g. a scale of 2 will give you two digits after the
decimal.
 

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