[AccessD] Currency vs Double

Rocky Smolin at Beach Access Software rockysmolin at bchacc.com
Sun Jan 13 21:18:49 CST 2008


So it sounds like  currency has its own rounding problems?  I'm trying to
avoid the rounding problem in an application and read somewhere that using
Currency data type accomplishes this.

Rocky





 	
	

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Sunday, January 13, 2008 7:07 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Currency vs Double

Rocky,

Currency only stores 4 decimal points, double stores "a lot" (don't have the
number off the top of my head).  A double is really a "floating point"
number whereas a currency is specifically used to handle money.  Currency
needs lots of numbers to the left of the decimal point, but does not need a
lot to the right.

Currency rounds numbers beyond the 4th decimal place to cause the 4th
decimal place to display the rounded effects of the 5th decimal place.  

123.45678 becomes 123.4568
123.45674 becomes 123.4567

Basically this results in differences between complex math operations.

?ccur(1/3)*3
 0.9999
?1/3*3
 1
?cdbl(1/3)*3
 1 

As you can see, because of the larger numbers of decimal points stored, a
float ends up with 1 from the previous operation whereas the currency type
ends up with .9999.



John W. Colby
Colby Consulting
www.ColbyConsulting.com
-----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 1:32 PM
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
 


 	
	
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.2/1223 - Release Date: 1/13/2008
8:23 PM
 




More information about the AccessD mailing list