Dim number As Variant
If (INT(number) = number) Then
If (INT(number)/number = 1) Then
If (TypeName(number) = "Integer") Then
If a variable needs to contain a whole number you can use Integer or Long.
If a variable needs to contain a fraction you can use Single, Double or Currency.
Floating Point Numbers
These are numbers that can be expressed as mm E ee, where mm is the mantissa and ee is the exponent (power of 10).
Removing Decimal Places
12.6 Mod 5 = 3
Only available in Excel
Avoid using floating-point data types. The Currency datatype is in fact faster than using the Single datatype because it doesn't use the floating point processor.
© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited