This simple data type denotes decimal numbers ranging from -999,999,999,999,999.99 to +999,999,999,999,999.99.

Example

The following are examples of decimal values.

  Copy Code
546.88
3425.57

The following is not a decimal, but rather an Integer Data Type.

  Copy Code
342

Changes from Previous Versions

In Microsoft Dynamics NAV 2013, the Decimal data type is mapped to the Microsoft .NET Framework common language runtime (CLR) Decimal data type and the precision and limits behave slightly differently than the Binary Coded Decimal (BCD) data type in previous versions of C/AL. This example shows how decimal data types are different in Microsoft Dynamics NAV 2013.

The following table shows the limits for variables of type DECIMAL in Microsoft Dynamics NAV 2013 and in previous versions.

Limit Microsoft Dynamics NAV 2013 Previous versions of Microsoft Dynamics NAV

Maximum format value.

This is the maximum value that can be:

  • Formatted into a TEXT variable by the FORMAT function.
  • Input from the UI or XMLPorts.
  • Assigned directly in source code.

+/- 999,999,999,999,999.99

+/- 999,999,999,999,999.99

Maximum field data type value.

This is the maximum value that a field variable in a record can hold while not being persisted.

+/- 999,999,999,999,999.99

+/- (9,99999999999999E+63)

Maximum persisted value.

This is the maximum value that can be stored in the database.

Can read previous stored values but cannot store values outside the formatting range since field variables cannot be assigned values outside the formatting range.

+/- 999.999.999.999.999.999,99

Maximum calculating value.

This is the maximum value that can be calculated by code statements while not assigning to a field variable, storing to the database, or formatting to a text variable.

+/- 79,228,162,514,264,337,593,543,950,335

+/- (9,99999999999999E+63)

This table shows that the maximum safe value that will work on all versions of Microsoft Dynamics NAV is +/- 999,999,999,999,999.99.

It is possible to assign to a variable the maximum value that can be formatted and then multiply that variable by a large positive number, thereby generating a greater value. However, we do not recommend doing this. If you do, you will get errors if you attempt to format this variable to a text variable or assign the variable to a field variable in a record.

See Also