[AccessD] Break a float into it's parts

Rocky Smolin at Beach Access Software rockysmolin at bchacc.com
Fri Feb 2 09:04:06 CST 2007


JC:

Will this do it?

Dim dblNumber As Double
Dim dblIntegerPart As Double
Dim dblDecimalPart As Double


dblNumber = 23.567
dblIntegerPart = Int(dblNumber)
dblDecimalPart = dblNumber - dblIntegerPart

MsgBox dblIntegerPart & " - " & dblDecimalPart

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of JWColby
Sent: Friday, February 02, 2007 6:37 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Break a float into it's parts

How do I get the integer part and the decimal part of a floating point
number
 
23.456
 
how do I get the 23
how do I get the .456
 
Using clng for example "rounds" the number up or down which isn't what I
want for the integer portion
 
John W. Colby
Colby Consulting
www.ColbyConsulting.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.432 / Virus Database: 268.17.19/663 - Release Date: 2/1/2007
2:28 PM
 




More information about the AccessD mailing list