Currency

From Xojo Documentation

Revision as of 20:01, 3 July 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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