[AccessD] Currency vs Double

Gustav Brock Gustav at cactus.dk
Mon Jan 14 11:37:36 CST 2008


Hi Rocky

Not directly as, say, Dim d As Dec. 
But you can declare a Variant and assign it decimals with CDec(<somevalue>).

/gustav

>>> rockysmolin at bchacc.com 14-01-2008 18:20:05 >>>
Decimal is available as a number data type in a table field but not as a
declaration in a Dim.

Rocky

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Monday, January 14, 2008 8:58 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Currency vs Double

The problem with doubles is floating point creep.  You can prove it by
merely taking 0 and adding and subtracting 1 repeatedly.  Somewhere in
there, you'll start picking up decimals way over to the right.  If a decimal
type is available, it's better to use that, but in Access, it depends on
what you're doing with the numbers.

Charlotte Foust

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Sunday, January 13, 2008 10:32 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Currency vs Double

 
Dear List:
 
Is there any difference between currency and double when working with
relatively small number - like under a million?  Does currency take care of
rounding errors which would happen in double calculations?
 
MTIA
 
Rocky





More information about the AccessD mailing list