Home / news / Format string. Format string Get the month in words from the date 1s

Format string. Format string Get the month in words from the date 1s

Parameters:

<Значение>

The value to be formatted.

<ФорматнаяСтрока>

The format string is a string value that includes formatting options.

Formatting options are listed through the ";" character. The presence of the parameter means that the formatting is different from the standard one.

If the parameter is not specified, then standard formatting is applied, which basically corresponds to converting the value to a string. However, for values ​​of type Number and Date, the default values ​​(0 and 01.01.0001 00:00:00 respectively) will return an empty string.

Each parameter is specified by the parameter name, the "=" symbol, and the parameter value. The parameter value can be specified in single or double quotes. This is required if the parameter value contains characters used in the format string syntax.

Arbitrary characters can be specified inside the parameter value, which will be displayed as is when forming the resulting string. Thus, for example, you can specify the separators for hours, minutes, and seconds when formatting time. If these characters match format string values, they must be enclosed in single quotes.

Names and values ​​of format string parameters:

  • L - the name of the language, country for which standard formatting will be performed.
  • CC - the total number of displayed decimal places of the integer and fractional parts. The original number is then rounded in accordance with the rounding rules. If this parameter is specified, then to display the fractional part of the number, the NPV parameter must be specified, otherwise the fractional part will not be displayed.
  • NDC - the number of decimal places in the fractional part. The original number is then rounded in accordance with the rounding rules.
  • CHS - bit shift: positive - division, negative - multiplication. In other words, this means that the original number will be multiplied or divided by 10*C, where C is the modulo value of the parameter.
  • FRD - the symbol-separator of the integer and fractional parts.
  • CHRG - character-separator of groups of the integer part of the number. If an empty string is used as a delimiter, then the delimiter will be a non-breaking space character.
  • CHN - a string representing the zero value of a number. If not set, the representation is an empty string. If "HN=" is specified, then in the form of "0". Not used for numeric input fields.
  • FHN - whether to output leading zeros. The value of this parameter is not set, the actual presence of the parameter determines the output of leading zeros.
  • ChG - the order of grouping the digits of the number. As a value, numbers are indicated, separated by commas, indicating the number of grouped digits from right to left. Only the first two numbers make sense. The first of these indicates the primary grouping, that is, the one that will be used for the least significant digits of the integer part of the number. If the second number is not specified, then only the least significant digits will be grouped. If 0 is specified as the second number, then the value specified for the primary grouping will be applied to all digits of the integer part of the number. If a value other than 0 is used as the second number, then this value will be used to group all digits, except for the least significant ones already grouped.
  • CHO - representation of negative numbers.
    • 0 (0) - string like "(1,1)";
    • 1 (1) - a string like "-1,1";
    • 2 (2) - a string like "- 1,1";
    • 3 (3) - a string like "1,1-";
    • 4 (4) - a string like "1,1 -".
  • DF - date format.
    • d - day of the month (in digits) without leading zero;
    • dd - day of the month (in digits) with a leading zero;
    • ddd - short name of the day of the week;
    • dddd - full name of the day of the week;
    • M - month number (in digits) without leading zero;
    • MM - month number (in digits) with a leading zero;
    • MMM - short name of the month;
    • MMMM - the full name of the month;
    • k is the number of the quarter in the year;
    • d - year number without century and leading zero;
    • yy - year number without century with leading zero;
    • yyyy - year number with century;
    • h - hour in 12 hour version without leading zeros;
    • hh - hour in 12 hour version with leading zero;
    • H - hour in 24-hour version without leading zeros;
    • HH (HH) - hour in 24 hour version with leading zero;
    • m - minute without leading zero;
    • mm - minute with leading zero;
    • s - second without leading zero;
    • ss - second with leading zero;
    • вв - display half of the day AM/PM (only valid for configuration languages ​​that support 12-hour time representation).
  • DLF - local date format. Specifies the option to display parts of the date.
    • D - date (in numbers);
    • DD - long date (month in words);
    • B - full time, date can be combined with time;
    • DV - date time.
  • DP is a string representing an empty date (for example, Format("00010101000000" ,"DP=""empty date""") would return the string "empty date").
  • BL - a string representing a boolean value Lie.
  • BI - a string representing a boolean value True.

Programming (and business programs) usually deal with the following simple data types: number, string, date. The values ​​of these types for different countries, standards, and just habits may have a different representation.

Probably the most famous example is the different representation of time - in Russia it is customary to use 9:00 and 21:00, and in English-speaking countries 9am and 9pm. The difference is both in logic (12-hour system or 24-hour system) and in writing.

The value representation is called "format" and today we will discuss changing the date format and number format in 1C.
You can use formatting both as a programmer in the 1C language, and visually, without programming, for example, when creating a printable form or report, when setting up elements on the form.

What is formatting

The number and date, regardless of its representation on the screen or on print, remains itself. Formatting means only conversion to a string value - that is, how it will “look” on a computer screen or on paper.

The main differences between 1C formats for representing numbers and dates:

  • Number
    o "." or "," to separate the fractional part
    o number of decimal places
    o grouping digits in 3's (1,000,000, not 1,000,000)
  • date and time
    o year, month, day order
    o delimiter character
    o 1C time format (12 or 24 hours)
    o spelling details.

Also, additional “conveniences” can be indicated in the 1C format, for example, display negative numbers in red, or the representation of an “empty value” in the form of “0” or “not filled”.

Formatting principle

The default formatting works, for example, when converting a number to a string. In some cases, such settings can serve a disservice where the programmer does not expect it.

For example, when converting a number to a string, it is translated taking into account the grouping of digits (and you expect this?):
StringNumber = AbbrLp(2400); //will be equal to "2 400"

To accurately specify the format in the 1C language, there is a Format () function, with which it is possible to specify the required representation.
NumberString = Format(2400, "Settings")

As the line "Settings" you need to specify the required format 1C. Such settings are specified in a special coded form. Consider the most commonly used settings:

Format 1С date and number by default

If you need to display a date or a number and don't want to bother with knowing how they should be represented according to the rules of the desired country, there is a simple setting that will allow you to do this:

L = ShortName of the Desired Country

An example of displaying a date according to the rules of some countries:
Format(CurrentDate(), "L=ru")
> 28.03.2012 14:21:32

Format(CurrentDate(), "L=en")
> 3/28/2012 2:21:24 PM

Format(CurrentDate(), "L=fr")
> 28/03/2012 14:22:08

As it is not difficult to see, the names of countries are intuitive.

Date format in 1C language

If the default setting is not enough for you and you would like to specify the order of the parts of the date and the symbols for their separation, you must use the setting:
DF = "dmg hms"

Accordingly, "dmg" is the day, month and year, and "hms" is hours, minutes and seconds. Any of these parts can be skipped. The order is any. The characters specified between the parts will be used as separator characters.

The character of a part of the date can be specified several times in a row, the appearance of this part of the date depends on this, for example, "d" or "dd" or "dddd".

Deciphering parts of the date:

  • d - day
    o small "d"
  • M - month
    o big "M"
    o can be specified from 1 to 4 times
  • d - year
    o small "g"
    o can be listed 1 or 2 or 4 times
  • h - hours
    o small "h" - 12 hour format
    o big "H" - 24 hour format
  • m - minutes
    o small "m"
    o can be specified 1 or 2 times
  • s - seconds
    o small "s"
    o can be specified 1 or 2 times
  • bb - AM/PM display for 12 hour format
  • k - quarter.

An example of displaying a date with rules:
Format(CurrentDate(), "DF=""dd.MM.yyyy hh:mm:ss""")
> 28.03.2012 02:44:44

Format(CurrentDate(), "DF="" M / d /yyy h:m:s dd""")
> 3/28/2012 2:44:44 PM

Format(CurrentDate(), "DF=""dd/MM/yyyy hh:mm:ss""")
> 28/03/2012 02:44:44

Number format in 1C language
Unlike date formatting, where everything is quite simple, there are many options for number formatting. We will consider those that we found useful - that is, in our opinion, they are often used.

The first "problem" is related to the default grouping of digits in numbers of 3 and separating the groups with a space, for example:
StrNumber = String(22300500)
> 22 300 500

This is inconvenient when a number is converted to a string not for a beautiful and understandable output to the user, but for service needs. This can be influenced by the "CH" parameter, for example:

Format(22300500, "HH=100")
>22300500 //removed zeros altogether

Format(22300500, "HH=6")
> 22 300500 //made a grouping of only millions

A parameter that allows you to round the number when outputting to the required number of digits after the decimal point "NPV":

Format(3.535353, "NPV=""2""")
> 3,54

Parameter that allows you to specify the separator character for the integer and fractional parts of the "BRD":

Format(3.535353, "BRD="".""")
> 3.535353

For some cases, it can be useful to be able to display something else instead of the number "0": an empty string or "not filled". This allows you to make the "CHN" parameter:

Format(0, "HN=""""")
>

Format 1C fields on the form

We have discussed with you the techniques that allow the programmer to format the value in the 1C language. There are also mechanisms that allow you to specify the required format visually, without programming.

For example, the user works with the form. The form has a field that displays the date. We can influence the representation of this date.

Open the properties of this field. To do this, in the thick client, right-click on the field, and in the thin client, right-click on the field name in the field list, select Properties.
The field has a "Format" property.

Click the "…" button to set it up. To set up the date format, use the Date tab (for a number, use the Number tab). You can select the required format from the list.

Format 1C cells in printed form

When you need to design a printed form (report or document printing), you can assign a cell format in exactly the same way as for a document field.
We select a cell (or several cells at the same time), go to the properties, the "Format" property, select the required format.

Format 1C in SKD

ACS reports allow you to customize the 1C format for both the programmer (at the time of creating the report) and the user (when using the report). There are also more opportunities through the use of conditional formatting.

This means you not only specify which field to format, but also under what condition (for example, if the value of this field is negative).

In the Enterprise mode, select the menu item on the report form "Change variant". In the ACS report in the thick client, this item is in the "Actions/Settings" menu.

In the opened form of all ACS settings there is a tab "Conditional formatting". Add a new line. The line has three columns:

  • Registration. Specify the required 1C format - font, background or text color, 1C format for displaying numbers and dates
  • Condition. If this design is always used, then leave this field blank. Otherwise, specify the field and its value. Then formatting will be applied only in those lines in which these values ​​match. If you need to specify the values ​​of several fields at the same time and the "and/or" conditions, add a group and group the fields using groups.
  • Formed fields. List of fields for which formatting will be applied.

1C format in managed forms

The same formatting rules apply to any managed tenant list form. In the list form, select the menu item "All actions / Configure list".

The Conditional Formatting tab.

Select the desired design and format.

Specify the list of fields to which this design will be applied.

Type: Number; Date of; Boolean. The value to be formatted.<ФорматнаяСтрока> (optional) Type: String. The format string is a string value that includes formatting options. Formatting options are listed through the symbol ";". The presence of the parameter means that the formatting is different from the standard one. If the parameter is not specified, then standard formatting is applied, which basically corresponds to converting the value to a string. However, for values ​​of type Number and Date, the default values ​​(0 and 01.01.0001 00:00:00 respectively) will return an empty string. Each parameter is specified by the parameter name, the "=" symbol, and the parameter value. The parameter value can be specified in single or double quotes. This is required if the parameter value contains characters used in the format string syntax. Arbitrary characters can be specified inside the parameter value, which will be displayed as is when forming the resulting string. Thus, for example, you can specify the separators for hours, minutes, and seconds when formatting time. If these characters match format string values, they must be enclosed in single quotes. Names and values ​​of format string parameters: L (L) - the name of the language, country for which standard formatting will be performed. The available language names are located after the format string description. NZ (ND) - the total number of displayed decimal places of the integer and fractional parts. The original number is then rounded in accordance with the rounding rules Okr15as20. If this parameter is specified, then to display the fractional part of the number, the NPV parameter must be specified, otherwise the fractional part will not be displayed. NFD (NFD) - the number of decimal places in the fractional part. The original number is then rounded in accordance with the rounding rules Okr15as20. ChS (NS) - bit shift: positive - division, negative - multiplication. In other words, this means that the original number will be multiplied or divided by 10*C, where C is the modulo value of the parameter. FRD (NDS) - the separator character of the integer and fractional parts. CHRG (NGS) - the character-separator of groups of the integer part of the number. If an empty string is used as a delimiter, then the delimiter will be a non-breaking space character. NZ (NZ) is a string representing the zero value of a number. If not set, the representation is an empty string. If "CHN=" is set, then in the form of "0". Not used for numeric input fields. NLZ — whether to display leading zeros. The value of this parameter is not set, the actual presence of the parameter determines the output of leading zeros. CHG (NG) - the order of grouping the digits of the number. As a value, numbers are indicated, separated by commas, indicating the number of grouped digits from right to left. Only the first two numbers make sense. The first of these indicates the primary grouping, that is, the one that will be used for the least significant digits of the integer part of the number. If the second number is not specified, then only the least significant digits will be grouped. If 0 is specified as the second number, then the value specified for the primary grouping will be applied to all digits of the integer part of the number. If a value other than 0 is used as the second number, then this value will be used to group all digits, except for the least significant ones already grouped. CHO (NN) - representation of negative numbers. 0 (0) - a string like "(1,1)"; 1 (1) - a string like "-1,1"; 2 (2) - a line like "- 1.1"; 3 (3) - a string like "1,1-"; 4 (4) - a string like "1,1 -". DF (DF) is the date format. d (d) — day of the month (in digits) without leading zero; dd (dd) — day of the month (in digits) with a leading zero; ddd (ddd) — short name of the day of the week *); dddd (dddd) — full name of the day of the week *); M (M) — month number (in digits) without leading zero; MM (MM) — number of the month (in digits) with a leading zero; MMM (MMM) - short name of the month *); MMMM (MMMM) is the full name of the month *); k (q) is the number of the quarter in the year; y (y) is the number of the year without the century and the leading zero; yy (yy) — year number without century with leading zero; yyyy (yyyy) — year number with century; h (h) - hour in 12-hour version without leading zeros; hh (hh) - hour in 12-hour version with a leading zero; H (H) - hour in 24-hour version without leading zeros; HH (HH) - hour in 24-hour version with a leading zero; m (m) - minute without leading zero; mm (mm) — minute with a leading zero; c (s) — second without leading zero; ss (ss) — second with leading zero; bb (tt) — AM/PM half day display (only valid for configuration languages ​​that support 12 hour time representation). Note: *) - not used for the format string of the date entry field. DLF (DLF) is the local date format. Specifies the option to display parts of the date. D (D) - date (in numbers); DD (DD) - long date (month in words); B (T) - full time, date can be combined with time; DV (DT) — date time. Example: The expression Format('20051120140323',"DLF=DDV") has the value "November 20, 2005 2:03:23 PM". Important! Order of format string options for DLF<дата + время>(DV or DVD) cannot be changed. DP (DE) is a string representing an empty date (for example, Format('00010101000000' ,"DP=""empty date""") would return the string "empty date"). BF (BF) is a string representing the boolean value False. BI (BT) is a string representing the boolean value True. Note. Using parameters for the input field: parameter DP (DE) is not used; parameter DLF (DLF) is only used with D (D), V (T) and DV (DT) values. Return value: Type: String. The string resulting from formatting the passed value. Description: Generates a human-readable representation of values. Useful in reports and other visual display of values. Availability: Thin client, web client, server, thick client, outer join , mobile application (client), mobile application (server). List of languages: af Afrikaans af_NA (af_NA) Afrikaans (Namibia) af_ZA Afrikaans (South Africa) am Amharic am_ET Amharic (Ethiopia) ar Arabic ar_AE Arabic (United Arab Emirates) ar_BH Arabic (Bahrain) ar_DZ Arabic (Algeria) ar_EG Arabic (Egypt) ar_IQ Arabic (Iraq) ar_JO Arabic (Jordan) ar_KW Arabic (Kuwait) ar_LB Arabic (Lebanon) ar_LY Arabic (Libya) ar_MA Arabic (Morocco) ar_OM Arabic (Oman) ar_QA Arabic (Qatar) ar_SA Arabic (Saudi Arabia) ar_SD Arabic (Sudan) ) ar_SY Arabic (Syria) ar_TN Arabic (Tunisia) ar_YE Arabic (Yemen) as Assamese as_IN Assamese (India) az Azerbaijani az_AZ Azerbaijani (Azerbaijan) az_Cyrl Azerbaijani (Cyrillic) az_Cyrl_AZ Azerbaijani (Cyrillic, Azerbaijan) az_Latn Azerbaijani (Latin) az_Latn_AZ Azerbaijani ( Latin, Azerbaijan) be Belarusian be_BY Belarusian (Belarus) bg Bulgarian bg_BG Bulgarian (Bulgaria) bn Bengal bn_IN Bengal (India) ca Catalan ca_ES Catalans cs Czech cs_CZ Czech (Czech Republic) cy Welsh cy_GB Welsh (UK) da Danish da_DK Danish (Denmark) de German de_AT German (Austria) de_BE German (Belgium) de_CH German (Switzerland) de_DE German (Germany) de_LI ( de_LI) German (Liechtenstein) de_LU German (Luxembourg) el Greek el_CY (el_CY) Greek (Cyprus) el_GR Greek (Greece) en English en_AU English (Australia) en_BE English (Belgium) en_BW English (Botswana) en_BZ (en_BZ) English (Belize) ) en_CA English (Canada) en_GB English (UK) en_HK English (Hong Kong, (Special Administration Area, China)) en_IE English (Ireland) en_IN English (India) en_JM (en_JM) English (Jamaica) en_MH (en_MH) English ( Marshall Islands) en_MT English (Malta) en_NA (en_NA) English (Namibia) en_NZ English (New Zealand) en_PH English (Philippines) en_PK English (Pakistan) en_SG English (Singapore) en_TT (en_TT) English th (Trinidad and Tobago) en_US English (United States of America) en_VI English (US Virgin Islands) en_ZA English (South Africa) en_ZW English (Zimbabwe) es Spanish es_AR Spanish (Argentina) es_BO Spanish (Bolivia) es_CL Spanish (Chile) es_CO Spanish (Colombia) es_CR Spanish (Costa Rica) es_DO Spanish (Dominican Republic) es_EC Spanish (Ecuador) es_ES Spanish (Spain) es_GT Spanish (Guatemala) es_HN Spanish (Honduras) es_MX Spanish (Mexico) es_NI Spanish (Nicaragua) es_PA Spanish (Panama) ) es_PE Spanish (Peru) es_PR Spanish (Puerto Rico) es_PY Spanish (Paraguay) es_SV Spanish (El Salvador) es_US Spanish (United States of America) es_UY Spanish (Uruguay) es_VE Spanish (Venezuela) et Estonian et_EE Estonian (Estonia) eu Basque eu_ES Basque (Spain) fa Persian fa_AF Persian (Afghanistan) fa_IR Persian (Iran) fi Finnish fi_FI Finnish (Finland) fo Faroese fo_FO Faroese (Faroe Islands) fr French French fr_BE French (Belgium) fr_CA French (Canada) fr_CH French (Switzerland) fr_FR French (France) fr_LU French (Luxembourg) fr_MC (fr_MC) French (Monaco) fr_SN (fr_SN) French (Senegal) ga Irish ga_IE Irish (Ireland) gl Galician gl_ES, Galician (Spain) gu Gujarati gu_IN Gujarati (India) he Hebrew he_IL Hebrew (Israel) hi Hindi hi_IN Hindi (India) hr Croatian hr_HR Croatian (Croatia) hu Hungarian hu_HU Hungarian (Hungary) hy Armenian hy_AM Armenian (Armenia) hy_AM_REVISED Armenian (Armenia, REVISED) id Indonesian id_ID Indonesian (Indonesia) is Icelandic is_IS Icelandic (Iceland) it Italian it_CH, Italian (Switzerland) it_IT Italian (Italy) ja Japanese ja_JP Japanese (Japan) ka Georgian ka_GE Georgian (Georgia) kk Kazakh kk_KZ Kazakh (Kazakhstan) kl Greenlandic kl_GL Greenlandic (Greenland) kn Kannada kn_IN Kannada (India) ko Korean ko_KR Korean ( South Korea ) kok Konkani kok_IN Konkani (India) ky Kyrgyz ky_KY Kyrgyz (Kyrgyzstan) lt Lithuanian lt_LT Lithuanian (Lithuania) lv Latvian lv_LV Latvian (Latvia) mk Macedonian mk_MK Macedonian (Macedonia) ml Malayalam ml_IN Malayalam (India) mr Maratha mr_IN Maratha (India) ms Malay ms_BN Malay (Brunei) ms_MY Malay (Malaysia) mt Maltese mt_MT Maltese (Malta) nb Norwegian Bokmål nb_NO Norwegian Bokmål (Norway) nl Dutch nl_BE Dutch (Belgium) nl_NL Dutch (Netherlands) nn Norwegian Nynorsk nn_NO Norwegian Nynorsk (Norwegian Nynorsk) Oromo (Afan) om_ET Oromo (Afan) (Ethiopia) om_KE Oromo (Afan) (Kenya) or Oriya or_IN Oriya (India) pa Punjabi pa_IN Punjabi (India) pl Polish pl_PL Polish (Poland) ps Pashto (Pushto) ps_AF Pashto (Pushto) ) (Afghanistan) pt Portuguese pt_BR Portuguese (Brazil) pt_PT Portuguese (Portugal) ro Romanian ro_RO Romanian (Romania) ru Russian ru_RU Russian (Russia) ru_UA Russian (Ukraine) sk Slovak sk_SK Slovak Somalia (Slovakia) sl Slovenian sl_SI Slovenian (Slovenia) so Somalia so_DJ Somalia (Djibouti) so_ET Somalia (Ethiopia) so_KE Somalia (Kenya) so_SO Somalia (Somalia) sq Albanian sq_AL Albanian (Albania) sr Serbian sr_BA (sr_BA) Serbian (Bosnia and Herzegovina) sr_CS Serbia (Serbia and Montenegro) sr_Cyrl Serbian (Cyrillic) sr_Cyrl_BA (sr_Cyrl_BA) Serbian (Cyrillic, Bosnia and Herzegovina) sr_Cyrl_CS Serbian (Cyrillic, Serbia and Montenegro) sr_Cyrl_ME (sr_Cyrl_ME) Serbian (Cyrillic, Montenegro) sr_Cyrl_RS (sr_Cyrl_RS) Serbia (Cyrillic, Serbia) sr_Latn Serbian (Latin) sr_Latn_BA (sr_Latn_BA) Serbian (Latin, Bosnia and Herzegovina) sr_Latn_CS Serbian (Latin, Serbia and Montenegro) sr_Latn_ME (sr_Latn_ME) Serbian (Latin, Montenegro) sr_Latn_RS (sr_Latn_RS) Serbian (Latin, Serbia ) sr_ME (sr_ME) Serbian (Montenegro) sr_RS (sr_RS) Serbian (Serbia) sv Swedish sv_FI Swedish (Finland) sv_SE Swedish (Sweden) sw Swahili sw_KE Swahili (Swahili) sw_TZ Swahili (Tanzania) ta Tami English ta_IN Tamil (India) te Telugu te_IN Telugu (India) th Thai th_TH Thai (Thailand) ti Tigrinia ti_ER Tigrinia (Eritrea) ti_ET Tigrinia (Ethiopia) tr Turkish tr_TR Turkish (Turkey) uk Ukrainian uk_UA Ukrainian (Ukraine) ur Urdu ur_PK Urdu (Pakistan) uz Uzbek uz_Cyrl Uzbek (Cyrillic) uz_Cyrl_UZ Uzbek (Cyrillic, Uzbekistan) uz_Latn Uzbek (Latin) uz_Latn_UZ Uzbek (Latin, Uzbekistan) uz_UZ Uzbek (Uzbekistan) vi Vietnamese vi_VN Vietnamese (Vietnam) zh Chinese zh_CN Chinese (Hans) zh_Hans_CN Chinese (Hans, China) zh_Hans_SG Chinese (Hans, Singapore) zh_Hant Chinese (Hant) zh_Hant_HK Chinese (Hant, Hong Kong (Special Administration Area, China)) zh_Hant_MO Chinese (Hant, Macau (Special Administration Area) , China)) zh_Hant_TW Chinese (Hant, Taiwan) zh_HK Chinese (Hong Kong (Special Administration Area, China)) zh_MO Chinese (Macau (Special Administration Area) Administrative Office, China)) zh_SG Chinese (Singapore) zh_TW Chinese (Taiwan)

Built-in language functions.Format (Script functions.Format)
Built-in language functions (Script functions)
Format
Syntax:
Format(<Значение>, <ФорматнаяСтрока>
Parameters:
<Значение>(mandatory)
Type: Number; Date of; Boolean. The value to be formatted.
<ФорматнаяСтрока>(optional)
Type: String. The format string is a string value that includes formatting options.
Formatting options are listed through the ";" character. The presence of the parameter means that the formatting is different from the standard one.
If the parameter is not specified, then standard formatting is applied, which basically corresponds to converting the value to a string. However, for values ​​of type Number and Date, the default values ​​(0 and 01.01.0001 00:00:00 respectively) will return an empty string.
Each parameter is specified by the parameter name, the "=" symbol, and the parameter value. The parameter value can be specified in single or double quotes. This is required if the parameter value contains characters used in the format string syntax. Arbitrary characters can be specified inside the parameter value, which will be displayed as is when forming the resulting string. Thus, for example, you can specify the separators for hours, minutes, and seconds when formatting time. If these characters match the format string values, they must be enclosed in single quotes.
Names and values ​​of format string parameters:
L (L) - The name of the language, country for which standard formatting will be performed. Available language names:
af Afrikaans
af_ZA Afrikaans (South Africa)
am Amharic
am_ET Amharic (Ethiopia)
ar Arabic
ar_AE Arabic (United Arab Emirates)
ar_BH Arabic (Bahrain)
ar_DZ Arabic (Algeria)
ar_EG Arabic (Egypt)
ar_IQ Arabic (Iraq)
ar_JO Arabic (Jordan)
ar_KW Arabic (Kuwait)
ar_LB Arabic (Lebanon)
ar_LY Arabic (Libya)
ar_MA Arabic (Morocco)
ar_OM Arabic (Oman)
ar_QA Arabic (Qatar)
ar_SA Arabic (Saudi Arabia)
ar_SD Arabic (Sudan)
ar_SY Arabic (Syria)
ar_TN Arabic (Tunisia)
ar_YE Arabic (Yemen)
as Assamese
as_IN Assamese (India)
az Azerbaijani
az_AZ Azeri (Azerbaijan)
az_Cyrl Azerbaijani (Cyrillic)
az_Cyrl_AZ Azerbaijani (Cyrillic, Azerbaijan)
az_Latn Azerbaijani (Latin)
az_Latn_AZ Azerbaijani (Latin, Azerbaijan)
be Belarusian
be_BY Belarusian (Belarus)
bg Bulgarian
bg_BG Bulgarian (Bulgaria)
bn Bengali
bn_IN Bengali (India)
ca Catalan
ca_ES Catalan (Spain)
cs czech
cs_CZ Czech (Czech Republic)
cy Welsh
cy_GB Welsh (UK)
da Danish
da_DK Danish (Denmark)
de German
de_AT German (Austria)
de_BE German (Belgium)
de_CH German (Switzerland)
de_DE German (Germany)
de_LU German (Luxembourg)
el Greek
el_GR Greek (Greece)
en English
en_AU English (Australia)
en_BE English (Belgium)
en_BW English (Botswana)
en_CA English (Canada)
en_GB English (UK)
en_HK English (Hong Kong, (Special Administration Area, China))
en_IE English (Ireland)
en_IN English (India)
en_MT English (Malta)
en_NZ English (New Zealand)
en_PH English (Philippines)
en_PK English (Pakistan)
en_SG English (Singapore)
en_US English (United States of America)
en_VI English (US Virgin Islands)
en_ZA English (South Africa)
en_ZW English (Zimbabwe)
es spanish
es_AR Spanish (Argentina)
es_BO Spanish (Bolivia)
es_CL Spanish (Chile)
es_CO Spanish (Colombia)
es_CR Spanish (Costa Rica)
es_DO Spanish (Dominican Republic)
es_EC Spanish (Ecuador)
es_ES Spanish (Spain)
es_GT Spanish (Guatemala)
es_HN Spanish (Honduras)
es_MX Spanish (Mexico)
es_NI Spanish (Nicaragua)
es_PA Spanish (Panama)
es_PE Spanish (Peru)
es_PR Spanish (Puerto Rico)
es_PY Spanish (Paraguay)
es_SV Spanish (El Salvador)
es_US Spanish (United States of America)
es_UY Spanish (Uruguay)
es_VE Spanish (Venezuela)
and Estonian
et_EE Estonian (Estonia)
eu Basque
eu_ES Basque (Spain)
fa Persian
fa_AF Persian (Afghanistan)
fa_IR Persian (Iran)
fi Finnish
fi_FI Finnish (Finland)
fo Faroese
fo_FO Faroese (Faroe Islands)
fr French
fr_BE French (Belgium)
fr_CA French (Canada)
fr_CH French (Switzerland)
fr_FR French (France)
fr_LU French (Luxembourg)
ga Irish
ga_IE Irish (Ireland)
gl Galician
gl_ES, Galician (Spain)
gu Guiarati
gu_IN Gujarati (India)
he Hebrew
he_IL Hebrew (Israel)
hi hindi
hi_IN Hindi (India)
hr Croatian
hr_HR Croatian (Croatia)
hu Hungarian
hu_HU Hungarian (Hungary)
hy Armenian
hy_AM Armenian (Armenia)
hy_AM_REVISED Armenian (Armenia, REVISED)
id Indonesian
id_ID Indonesian (Indonesia)
is Icelandic
is_IS Icelandic (Iceland)
it italian
it_CH, Italian (Switzerland)
it_IT Italian (Italy)
ja Japanese
ja_JP Japanese (Japan)
ka Georgian
ka_GE Georgian (Georgia)
kk Kazakh
kk_KZ Kazakh (Kazakhstan)
kl Greenlandic
kl_GL Greenlandic (Greenland)
kn Kannada
kn_IN Kannada (India)
ko Korean
ko_KR Korean (South Korea)
Kok Konkani
kok_IN Konkani (India)
lt Lithuanian
lt_LT Lithuanian (Lithuania)
lv Latvian
lv_LV Latvian (Latvia)
mk Macedonian
mk_MK Macedonian (Macedonia)
ml Malayalam
ml_IN Malayalam (India)
mr Maratian
mr_IN Maratian (India)
ms Malay
ms_BN Malay (Brunei)
ms_MY Malay (Malaysia)
mt Maltese
mt_MT Maltese (Malta)
nb Norwegian Bokmål
nb_NO Norwegian Bokmål (Norway)
nl Dutch
nl_BE Dutch (Belgium)
nl_NL Dutch (Netherlands)
nn Norwegian Nynorsk
nn_NO Norwegian Nynorsk (Norway)
om Oromo (Athan)
om_ET Oromo (Afan) (Ethiopia)
om_KE Oromo (Afan) (Kenya)
or Oriya
or_IN Oriya (India)
pa Punjabi
pa_IN Punjabi (India)
pl Polish
pl_PL Polish (Poland)
ps Pashto (Pashto)
ps_AF Pashto (Pushto) (Afghanistan)
pt Portuguese
pt_BR Portuguese (Brazil)
pt_PT Portuguese (Portugal)
ro Romanian
ro_RO Romanian (Romania)
en Russian
en_RU Russian (Russia)
ru_UA Russian (Ukraine)
sk Slovak
sk_SK Slovak (Slovakia)
sl Slovenian
sl_SI Slovenian (Slovenia)
so Somalia
so_DJ Somalia (Djibouti)
so_ET Somalia (Ethiopia)
so_KE Somalia (Kenya)
so_SO Somalia (Somalia)
sq Albanian
sq_AL Albanian (Albania)
Serbian
sr_CS Serbian (Serbia and Montenegro)
sr_Cyrl Serbian (Cyrillic)
sr_Cyrl_CS Serbian (Cyrillic, Serbia and Montenegro)
sr_Cyrl_YU Serbian (Cyrillic, Yugoslavia)
sr_Latn Serbian (Latin)
sr_Latn_CS Serbian (Latin, Serbia and Montenegro)
sr_Latn_YU Serbian (Latin, Yugoslavia)
sr_YU Serbian (Yugoslavia)
swedish
sv_FI Swedish (Finland)
sv_SE Swedish (Sweden)
swahili
sw_KE Swahili (Swahili)
sw_TZ Swahili (Tanzania)
ta Tamil
ta_IN Tamil (India)
Telugu
te_IN Telugu (India)
th Thai
th_TH Thai (Thailand)
ti Tigrinia
ti_ER Tigrinia (Eritrea)
ti_ET Tigrinia (Ethiopia)
tr Turkish
tr_TR Turkish (Turkey)
UK Ukrainian
uk_UA Ukrainian (Ukraine)
ur urdu
ur_PK Urdu (Pakistan)
uz Uzbek
uz_Cyrl Uzbek (Cyrillic)
uz_Cyrl_UZ Uzbek (Cyrillic, Uzbekistan)
uz_Latn Uzbek (Latin)
uz_Latn_UZ Uzbek (Latin, Uzbekistan)
uz_UZ Uzbek (Uzbekistan)
vi Vietnamese
vi_VN Vietnamese (Vietnam)
zh Chinese
zh_CN Chinese (China)
zh_Hans Chinese (Hans)
zh_Hans_CN Chinese (Hans, China)
zh_Hans_SG Chinese (Hans, Singapore)
zh_Hant Chinese (Hant)
zh_Hant_HK Chinese (Hant, Hong Kong (Special Administration Area, China))
zh_Hant_MO Chinese (Hant, Macau (Special Administration Area, China))
zh_Hant_TW Chinese (Hant, Taiwan)
zh_HK Chinese (Hong Kong (Special Administration Area, China))
zh_MO Chinese (Macau (Special Administration Area, China))
zh_SG Chinese (Singapore)
zh_TW Chinese (Taiwan)
NZ (ND) - The total number of displayed decimal places of the integer and fractional parts. The original number is then rounded in accordance with the rounding rules Okr15as20. If this parameter is specified, then to display the fractional part of the number, the NPV parameter must be specified, otherwise the fractional part will not be displayed.
NFD (NFD) - The number of decimal places in the fractional part. The original number is then rounded in accordance with the rounding rules Okr15as20.
CHS (NS) - Bit shift: positive - division, negative - multiplication. In other words, this means that the original number will be multiplied or divided by 10*C, where C is the modulo value of the parameter.
FRD (NDS) - Symbol-separator of integer and fractional parts.
CHRG (NGS) - The group separator character of the integer part of the number. If an empty string is used as a delimiter, then the delimiter will be a non-breaking space character.
NZ (NZ) - A string representing the zero value of a number. If not set, the representation is an empty string. If "HN=" is specified, then in the form of "0". Not used for numeric input fields.
NLZ - Whether to display leading zeros. The value of this parameter is not set, the actual presence of the parameter determines the output of leading zeros.
CHG (NG) - The order of grouping the digits of the number. As a value, numbers are indicated, separated by commas, indicating the number of grouped digits from right to left. To specify that the last grouping number should be repeated for all high-order digits, a 0 is specified after it, separated by a comma.
CHO (NN) - Representation of negative numbers.
0 - string like "(1,1)";
1 - string like "-1,1";
2 - a line like "- 1,1";
3 - string like "1,1-";
4 - a line like "1,1 -".
DF (DF) - Date format.
d (d) - day of the month (in digits) without leading zero;
dd (dd) - day of the month (in digits) with a leading zero;
ddd (ddd) - short name of the day of the week *);
dddd (dddd) - full name of the day of the week *);
M (M) - month number (in digits) without leading zero;
MM (MM) - number of the month (in digits) with a leading zero;
MMM (MMM) - short name of the month *);
MMMM (MMMM) - full name of the month *);
k (q) - the number of the quarter in the year;
y (y) - year number without century and leading zero;
yy (yy) - year number without century with leading zero;
yyyy (yyyy) - year number with century;
h (h) - hour in 12-hour version without leading zeros;
hh (hh) - hour in 12 hour version with leading zero;
H (H) - hour in 24-hour version without leading zeros;
HH (HH) - hour in 24 hour version with leading zero;
m (m) - minute without leading zero;
mm (mm) - minute with leading zero;
s (s) - second without leading zero;
ss (ss) - second with leading zero;
вв (tt) - display half of the day AM/PM (only valid for configuration languages ​​that support 12-hour time representation).
Note: *) - not used for the format string of the date entry field.
DLF (DLF) - Local date format. Specifies the option to display parts of the date.
D (D) - date (in numbers);
DD (DD) - long date (month in words);
B (T) - full time, date can be combined with time;
DV (DT) - date time.
Example: Format("20051120140323","DLF=DDV") is "November 20, 2005 2:03:23 PM".
Important! Order of format string options for DLF<дата + время>(DV or DVD) cannot be changed.
DP (DE) - A string representing an empty date (for example, Format("00010101000000" ,"DP=""empty date""") would return the string "empty date").
BF (BF) - A string representing the boolean value False.
BI (BT) - A string representing the boolean value True.
Note. Using parameters for the input field: parameter DP (DE) is not used; parameter DLF (DLF) is only used with D (D), V (T) and DV (DT) values.
Return value:
Type: String. The string resulting from formatting the passed value.
Description:
Generates a human-readable representation of the values. Useful in reports and other visual display of values.

Availability:
Thin client, web client, server, external connection.
Example:
// Number formatting examples
A = Format(123456.789, "NPV=10; NPV=2");
// A = "123456.79"
A = Format(123456.789, "FRD="-"");
// A = "123 456-789"
A = Format(-123456.789, "CHO=0");
// A = "(123456.789)";

// Date formatting examples
A = Format("20020820153309", "DF=""dd MMMM yyyy "y." HH:mm:ss""");
// A = "Aug 20, 2002 3:33:09 PM"
A = Format("20020820153309", "DF=""dd/MM-yyyy""");
// A = "20/08-2002"
A = Format("20020820153309", "DLF=DD");
// A = "August 20, 2002";
A = Format("20020820153309", "DLF=D");
// A = "20.08.2002";
A = Format("20020820153309", "DLF=B");
// A = "15:33:09";

// Examples of formatting boolean expressions
A = Format(True, "BL=Not available; BI=Available");
// A = "Available";