Currency

From Xojo Documentation

Data Type


A a decimal number that holds 15 digits to the left of the decimal point and 4 digits to the right. The default value of a Currency is 0.0.

Methods
ToString ToText
Shared Methods
FromString FromText

Notes

Currency can contain values from -922337203685477.5808 to 922337203685477.5807. It uses 8 bytes.

Currency is a 64-bit fixed-point decimal. This means that Currency does not have some of the rounding issues that are inherent in floating-point numbers stored in Double.

Use Currency instead of Double when storing monetary values. Since Double is a standard double-precision floating-point number, it is unable to store some specific decimal values. The Currency type avoids these issues, which can be particularly important with rounding and when dealing with money.

Sample Code

Assign a value to a currency variable:

Var c As Currency
c = 42.56

See Also

Double data type