C Cheetah Well-known member Joined Oct 12, 2006 Messages 232 Programming Experience Beginner Nov 18, 2006 #1 How do i check if a double is a whole number without converting it to a string first? Is this possible? Is there a function? Thanks.
How do i check if a double is a whole number without converting it to a string first? Is this possible? Is there a function? Thanks.
JohnH VB.NET Forum Moderator Staff member Joined Dec 17, 2005 Messages 15,858 Location Norway Programming Experience 10+ Nov 18, 2006 #2 Convert it to Integer and check if that is equal to original value. If CInt(doublevalue) = doublevalue ... Upvote 0 Downvote
Convert it to Integer and check if that is equal to original value. If CInt(doublevalue) = doublevalue ...
C Cheetah Well-known member Joined Oct 12, 2006 Messages 232 Programming Experience Beginner Nov 18, 2006 #3 Would that be more efficient that doing a ToString and checking if it contains a "." (as in decimal place)? Upvote 0 Downvote
Would that be more efficient that doing a ToString and checking if it contains a "." (as in decimal place)?