Currency Data in field

D

dhstein

I have a field that gets data from a table. The value in the table is
currency and the field is formatted as currency. The value is .30 (30
cents) which I originally typed into the table manually as .30. When the
field displays it shows as $.30. If I try to edit the field, the value
displayed changes to .300000011920929 This is likely to be confusing to the
user and in addition I just want to understand it and get rid of it. No
doubt it's related to storing a floating point number, but I want to suppress
all these extraneous digits when the user edits. Thanks for any help on this.
 
J

John W. Vinson

I have a field that gets data from a table. The value in the table is
currency and the field is formatted as currency. The value is .30 (30
cents) which I originally typed into the table manually as .30. When the
field displays it shows as $.30. If I try to edit the field, the value
displayed changes to .300000011920929 This is likely to be confusing to the
user and in addition I just want to understand it and get rid of it. No
doubt it's related to storing a floating point number, but I want to suppress
all these extraneous digits when the user edits. Thanks for any help on this.

Open the table in design view and select this field. What is the datatype (in
the second column of the field definition?) I'm certain that it's Number, and
that the size of the field (in the field properties in the lower left) is
Double.

The *FORMAT* of the field is irrelevant to how it's stored. You need to change
the datatype from Number to Currency, which will be stored as a huge scaled
integer with four decimals and no roundoff error.
 

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