Decimal precision and calculations

  • Thread starter Thread starter Krisse
  • Start date Start date
K

Krisse

I need to have what I see be what I get in mathmatical
calculations. I am struggling with odd fractions of a
penny.

I am dealing with dollars, but in the end I need to create
a number with 2 digits to the right of an implied decimal
in order to load data into a system conversion table.

Is there a best way to define these numeric fields?
(Fieldsize double, format, decimal places). I see that
numbers are not always stored as they look, even with a
currency data type. I've been using double, but am still
having trouble sometimes.

Can you help? Thanks!
 
Use the Round() function to force the data to 2 decimal places before
storing.

The Double is probably the most appropriate type, but the Currency type will
be more precise as it can store the fractional part exactly.
 
Thanks, Allen.


-----Original Message-----
Use the Round() function to force the data to 2 decimal places before
storing.

The Double is probably the most appropriate type, but the Currency type will
be more precise as it can store the fractional part exactly.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.




.
 
Back
Top