{"title":"AutoFormatType Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-autoformattype-property/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-autoformattype-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sets a value that determines how data is formatted, together with the AL expression in the AutoFormatExpression Property.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":182,"chars":54},{"level":2,"title":"Syntax","slug":"syntax","at":236,"chars":82},{"level":2,"title":"Property value","slug":"property-value","at":318,"chars":264},{"level":2,"title":"Remarks","slug":"remarks","at":582,"chars":896},{"level":2,"title":"Example 1","slug":"example-1","at":1478,"chars":472},{"level":2,"title":"Example 2","slug":"example-2","at":1950,"chars":234},{"level":2,"title":"Example 3","slug":"example-3","at":2184,"chars":253},{"level":2,"title":"Example 4","slug":"example-4","at":2437,"chars":156},{"level":2,"title":"Related information","slug":"related-information","at":2593,"chars":121}],"text":"> Version: _Available or changed with runtime version 1.0._\nSets a value that determines how data is formatted, together with the AL expression in the AutoFormatExpression Property.\n## Applies to\n Table field\n Page Field\n Report Column\n## Syntax\n```al\nAutoFormatExpression = '<Currency Code>';\nAutoFormatType = 2;\n```\n## Property value\n`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.\n## Remarks\nThe 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.\nType of data|Value|Meaning\nOther types of data|AutoFormatType must be `0` and AutoFormatExpr must be blank|Use default settings for formatting (Standard format 0).\nAmount|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.\nUnit amount|AutoFormatType must be `2` and AutoFormatExpr must return a currency code|Format as unit amount data, for example used for unit prices.\n## Example 1\nThe following example uses AutoFormatType and AutoFormatExpression property to set the format of decimal values to USD.\n```al\nAutoFormatExpression = 'USD';\nAutoFormatType = 1;\n```\nFor example, this results in a value like `7,564.00`.\nChanging the AutoFormatExpression property to IRD sets the format of decimal values to IDR \\(Indonesian rupiah\\).\n```al\nAutoFormatExpression = 'IRD';\nAutoFormatType = 1;\n```\nFor example, this results in a value like `7,564`.\n## Example 2\nThe following example is similar to the previous example, except it adds a `$` sign before the amount.\n```al\nAutoFormatExpression = '1,USD';\nAutoFormatType = 10;\n```\nFor example, this results in a value like `$7,564.00`.\n## Example 3\nThis example prefixes the decimal value with a `$`, includes a thousand separator, and has a maximum of two decimal places, such as `$76,453.21`:\n```al\nAutoFormatType = 1;\nAutoFormatExpression = '$<precision, 2:2><standard format, 0>';\n```\n## Example 4\nThis example sets the decimal precision to a minimum of `1` decimal and a maximum of `3`.\n```al\nAutoFormatType = 0;\nDecimalPlaces = 1 : 3;\n```\n## Related information\ndevenv-autoformatexpression-property\nFormatting values, dates, and time<../devenv-format-property>"}