Numbers

When you think of numbers, you need to put them into two classifications:
Numbers that do not have a decimal point (whole numbers, integers)
Numbers that have a decimal point (real numbers, floating point)


Integers (No Decimal Point)

If a variable needs to contain a whole number you can use the Integer or Long data type.


Floating Point Numbers

If a variable needs to contain a number that has a decimal point you can use the Single or Double data type.
These two data types have Floating Point precision.
The term floating point refers to the fact that the decimal point can "float/move" to the left or right, between the significant digits of the number.

The Single data type uses Single Precision Floating Point.
The Double data type uses Double Precision Floating Point.
The Single and Double data types allow us to specify extremely small and large numbers.
Depending on what the numbers represent, you can encounter rounding errors when performing operations with floating-point numbers.
If your calculations need to be very accurate then you might want to use a Scaled Integer / Fixed Point data type.


Currency and Decimal Data Types

If you need a high level of accuracy you can use the Currency or Variant/Decimal data type.
The variant has a special sub type called Variant/Decimal that can be used to hold very large numbers.


Application.WorksheetFunction.Pi

Only available in Excel


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopNext