Dropping the zero

  • Thread starter Thread starter Ozzie
  • Start date Start date
O

Ozzie

I have a field set up with its data type set to number. If I enter "123.10"
into the field, the zero will be dropped resulting in "123.1". I have
changed the data type, format, decimal places, and field sizes, in hopes of
keeping the zero without success. I think the "Standard" format with
"Decimal" set to 2 might work, but standard format sticks in a comma which I
do not want. Any thoughts how I might keep the zero? Thanks
 
Fixed works, but then every entry in the field will have two decimal places,
so this won't work either.
 
Fixed works, but then every entry in the field will have two decimal places,
so this won't work either.

If you mean that you want to have 123.1, 123.10, and 123.100 as
distinct values, you're out of luck (unless you use a Text datatype
rather than any sort of number). Number fields are NOT stored as
digits and punctuation, they're stored as binary bitstrings; and these
three values are (numerically) stored identically; they're the *same
number*.
 
Do you mean that if you enter "123.1", Access keeps it as
123.1 but if you enter "123.10", Access keeps it as 123.10
and if you enter as "123.100", Access keeps it as 123.100?

Note that all 3 above are the same numerically.
Mathematicians use the zeros in decimal places to indicate
the accuracy to 1, 2 or 3 decimal places but this use is a
convention, not an in-built property of the value 123.1

The work-around is to store hem as Text rather than Number
and use code (or relying on automatic type-casting) to
manupulate them numerically. I actually use this method
in one of my databases to store QC Lab results where some
specs and results are required to 1 decimal places and
some others up to 3 decimal places.

HTH
Van T. Dinh
MVP (Access)
 
Each of you have confirmed my thoughts. Thank you. Now to figure out how
to get "Text" to display sequentially (1, 2, 3....) when numbers are used in
each field........
 
Eval(), CDbl(), etc... to convert Text to Number.

Check Access Help on conversion functions.
 
Back
Top