Numeric Data Type

To indicate magnitude, use the Numeric data type. Numeric values contain digits from 0 to 9 and, optionally, a sign and a decimal point. Visual FoxPro supports hexadecimal values for numeric data. For example, the decimal value 255 can be represented as 0xFF.

NoteTip

For precise financial calculations, use the Currency data type instead of Numeric. You can convert values from Numeric to Currency and the reverse using the NTOM( ) and MTON( ) functions. For more information, see Currency Data Type, NTOM( ) Function, and MTON( ) Function.

In fields with Numeric data type, the length of the decimal portion is determined at design time when you create the field. The length of the decimal portion is part of the total length. For example, if you specify a length of 6 for a numeric field and a decimal setting of 4, the field can store values up to 9.9999.

For specifications about the Numeric data type, see Visual FoxPro Data and Field Types.

Expand imageNumeric Precision

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic