# AutoFormatType Property
> Version: _Available or changed with runtime version 1.0._
Sets a value that determines how data is formatted, together with the AL expression in the AutoFormatExpression Property.
## Applies to
 Table field
 Page Field
 Report Column
## Syntax
```al
AutoFormatExpression = '<Currency Code>';
AutoFormatType = 2;
```
## Property value
`0`, `1`, `2`, `3`, `10`, or `11`. For an explanation of all of these values, see Formatting decimal values in fields<../devenv-format-field-data>. In the following table, the values for formatting decimal values `0`, `1`, and `2` are explained.
## Remarks
The AutoFormatType and AutoFormatExpression properties are only used to format decimal data types, such as amounts that can be stated in a foreign currency or ratios. The settings for the AutoFormatType property and the AutoFormatExpr property depend on the type of data in the field that you need to format. There are three categories of data: amount, unit amount, and other types of data.
Type of data|Value|Meaning
Other types of data|AutoFormatType must be `0` and AutoFormatExpr must be blank|Use default settings for formatting (Standard format 0).
Amount|AutoFormatType must be `1` and AutoFormatExpr must return a currency code|Format as amount data, for example used for line amounts, document totals, or any accounting values.
Unit amount|AutoFormatType must be `2` and AutoFormatExpr must return a currency code|Format as unit amount data, for example used for unit prices.
## Example 1
The following example uses AutoFormatType and AutoFormatExpression property to set the format of decimal values to USD.
```al
AutoFormatExpression = 'USD';
AutoFormatType = 1;
```
For example, this results in a value like `7,564.00`.
Changing the AutoFormatExpression property to IRD sets the format of decimal values to IDR \(Indonesian rupiah\).
```al
AutoFormatExpression = 'IRD';
AutoFormatType = 1;
```
For example, this 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;
```
For example, this 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
This example sets the decimal precision to a minimum of `1` decimal and a maximum of `3`.
```al
AutoFormatType = 0;
DecimalPlaces = 1 : 3;
```
## Related information
devenv-autoformatexpression-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-autoformattype-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-autoformattype-property/
