Decimal places doesn't seem to work

L

Laurel

I have a report which displays some numbers. I choose "general number" as
the format, and "1" as the number of decimal places. But it displays up to
3 decimal places. Any suggestions?

TIA
LAS
 
M

Marshall Barton

Laurel said:
I have a report which displays some numbers. I choose "general number" as
the format, and "1" as the number of decimal places. But it displays up to
3 decimal places.

It sounds like your number is a text string or was
concatenated into a text string. Post the text box's
control source and explain the data type of the field(s).
 
L

Laurel

The control source is "Principle1" (one of 5, actually, Principle1,
Principle2, etc.). It is a column in a table of type Number, Single,
nothing in "Format." It is loaded by the following bit of code.

!Principle2 = isng_Principle2 / (ii_Principle2Count)

The other variables are "single" and "integer".
 
D

Duane Hookom

Different Formats afford different property settings.

From the answer to Marsh's reply, it looks like your table(s) might be
un-normalized.
 
M

Marshall Barton

I see that Duane's suggestion got you past your immediate
problem. Personally, I would use a specific format such as
#,##0.0
but that's just because I can not remember what the named
formats really do.

As Duane also mentioned, it looks like you might have bigger
problems with the table having inter-related fields, which
would be a violation of The Rules of Relational Database
Normalization (google it).
 
V

Vladimír Cvajniga

I see that Duane's suggestion got you past your immediate
problem.  Personally, I would use a specific format such as
        #,##0.0
but that's just because I can not remember what the named
formats really do.

As Duane also mentioned, it looks like you might have bigger
problems with the table having inter-related fields, which
would be a violation of The Rules of Relational Database
Normalization (google it).
--
Marsh
MVP [MS Access]
The control source is "Principle1" (one of 5, actually, Principle1,
Principle2, etc.).  It is a column in a table of type Number, Single,
nothing in "Format."  It is loaded by the following bit of code.
          !Principle2 = isng_Principle2 / (ii_Principle2Count)
The other variables are "single" and "integer".
"Marshall Barton" wrote

It must NOT be a violation of The Rules of Relational Database
Normalization, it may be a bug in Access. In some cases Access doesn't
recognize type of calculated fields in query. Especially if you use Nz
function; in such case you wil not be able to get decimal places, even
if you use Val(Nz(..., 0))! Similar behaviour with Switch, etc.
Generally, it's one of too many Access' bugs. :-(
 

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