# AutoFormatExpression Property
> Version: _Available or changed with runtime version 1.0._
Sets an AL expression that specifies how to format data.
## Applies to
 Table field
 Page Field
 Report Column
## Syntax
```al
AutoFormatExpression = '<Currency Code>';
AutoFormatType = 2;
```
## Remarks
Applies to fields or columns of the decimal data type.
The AL expression is evaluated when the expression performs updates. Together with the devenv-autoformattype-property, this property determines how data is formatted. These two properties are only used to format decimal data types, such as amounts that can be stated in a foreign currencies or ratios.
See Formatting decimal values in fields<../devenv-format-field-data>.
## Example 1
The following example uses AutoFormatExpression property to set the format of decimal values to USD.
```al
AutoFormatExpression = 'USD';
AutoFormatType = 1;
```
This example results in a value like `7,564.00`.
Changing the AutoFormatExpression property to `ÌRD` sets the format of decimal values to IDR \(Indonesian rupiah\).
```al
AutoFormatExpression = 'IRD';
AutoFormatType = 1;
```
This example results in a value like `7,564`.
## Example 2
The following example is similar to the previous example, except it adds a `$` sign before the amount.
```al
AutoFormatExpression = '1,USD';
AutoFormatType = 10;
```
This example results in a value like `$7,564.00`.
## Example 3
This example prefixes the decimal value with a `$`, includes a thousand separator, and has a maximum of two decimal places, such as `$76,453.21`:
```al
AutoFormatType = 1;
AutoFormatExpression = '$<precision, 2:2><standard format, 0>';
```
## Example 4
> NOTE
> > APPLIES TO: Business Central 2025 release wave 1 (v26) and later.
This example writes the number with two decimals, encloses the number in parenthesis if negative and 'Zero' if the value is `0`.
This uses the standard .NET numeric formatting system. See https://learn.microsoft.com/dotnet/standard/base-types/custom-numeric-format-strings.
```al
AutoFormatType = 1;
AutoFormatExpression = '<FormatString>#,##0.00;(#,##0.00);Zero';
```
## Related information
devenv-autoformattype-property
devenv-decimalplaces-property
Formatting values, dates, and time<../devenv-format-property>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-autoformatexpression-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-autoformatexpression-property/
