# System.Format(Any [, Integer] [, Integer]) Method
> Version: _Available or changed with runtime version 1.0._
Formats a value into a string.
## Syntax
```al
String :=   System.Format(Value: Any [, Length: Integer] [, FormatNumber: Integer])
```
> NOTE
> This method can be invoked without specifying the data type name.
## Parameters
Value
Type: ../any/any-data-type
This is an AL variable (expression) of any simple data type, such as Option, Integer, BigInteger, Decimal, Char, Text, Code, Date, Time, DateTime, Boolean, or GUID. If, when the system formats Value, the result is a value larger than the maximum length MAXSTRLEN method (Code, Text) of String, a run-time error occurs.
*[Optional] Length*
Type: ../integer/integer-data-type
This optional parameter specifies the length of String.
*[Optional] FormatNumber*
Type: ../integer/integer-data-type
This optional parameter specifies the format that you want to use.
## Return Value
String
Type: ../text/text-data-type
## Remarks
The FormatNumber parameter specifies the format that you want to use. The basic options for the Decimal data type are as follows:
 <*Sign*><*Integer Thousand*><*Decimals*> is Format 0
 <*Sign*><*Integer*><*Decimals*> is Format 1
 <*Sign*><*Integer*><*Decimals*><*Comma*,.> is Format 2
 <*Integer Thousand*><*Decimals*><*Sign,1*> is Format 3
 <*Integer*><*Decimals*><*Sign,1*> is Format 4
See Formatting Values, Dates, and Time<../../devenv-format-property>).
## Related information
system-data-type
Get started with AL<../../devenv-get-started>
Developing extensions<../../devenv-dev-overview>

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/methods-auto/system/system-format-joker-integer-integer-method, 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/methods-auto/system/system-format-joker-integer-integer-method/
