jwcolby
jwcolby at colbyconsulting.com
Sun Jan 13 21:07:06 CST 2008
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