Type: Number; Date of; Boolean. The value to be formatted.<ФорматнаяСтрока> (optional) Type: String. A format string is a string value that includes formatting options. Formatting options are listed separated by the “;” symbol. The presence of a parameter means that the formatting differs 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 value (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 necessary if the parameter value contains characters used in format string syntax. Arbitrary characters can be specified inside the parameter value, which will be displayed as is when generating the resulting string. This way, for example, you can specify hour, minute, and second separators 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) - name of the language, country for which standard formatting will be performed. Available language names are located after the format string description. ND - the total number of decimal places displayed for both the integer and fractional parts. The original number is rounded in accordance with the rounding rules Okr15as20. If this parameter is specified, then to display the fractional part of a number, it is necessary to specify the NPV parameter, otherwise the fractional part will not be displayed. NFD - the number of decimal places in the fractional part. The original number is rounded in accordance with the rounding rules Okr15as20. ChS (NS) - shift of digits: 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 absolute value of the parameter. NDS is a symbol that separates the integer and fractional parts. CHRG (NGS) is a group separator symbol for an integer part of a number. If you use an empty string 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 specified, then represented as an empty string. If “CHN=” is specified, then in the form “0”. Not used for numeric input fields. CHN (NLZ) - whether leading zeros should be output. The value of this parameter is not specified; the presence of the parameter itself determines the output of leading zeros. CHG (NG) - the order of grouping the digits of a number. The values ​​are numbers, 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, only the least significant digits will be grouped. If 0 is specified as the second number, then for all digits of the integer part of the number the value specified for the primary grouping will be applied. If a value other than 0 is used as the second number, then this value will be used to group all digits except the least significant ones already grouped. CHO (NN) is a representation of negative numbers. 0 (0) — a string like “(1,1)”; 1 (1) — a string like “-1,1”; 2 (2) — a string of the form “- 1,1”; 3 (3) — a string of the form “1,1-“; 4 (4) — a string of the form “1,1 -“. DF (DF) - date format. d (d) — day of the month (in numbers) without leading zero; dd (dd) — day of the month (in numbers) 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) — month number (in numbers) without leading zero; MM (MM) - month number (in numbers) with a leading zero; MMM (MMM) - short name of the month *); MMMM (MMMM) - full name of the month *); k (q) - number of the quarter in the year; g (y) — year number without century and leading zero; yy (yy) - number of the year without a century with a leading zero; yyyy (yyyy) - year number with century; h (h) — hour in the 12-hour version without leading zeros; hh (hh) — hour in the 12-hour version with a leading zero; H (H) — hour in 24-hour format without leading zeros; HH (HH) — hour in 24-hour mode with a leading zero; m (m) — minute without leading zero; mm (mm) — minute with leading zero; s (s) — second without a leading zero; ss (ss) — second with a leading zero; bb (tt) - display half of the day AM/PM (valid only for configuration languages ​​that support the 12-hour time display option). Note: *) - is not used for the format string of the date entry field. DLF is a local date format. Specifies the option for displaying date parts. D (D) - date (in numbers); DD (DD) - long date (month in words); B (T) - full time, date can be combined with time; DT - date time. Example: the expression Format('20051120140323',"DLF=DDV") has the value "November 20, 2005 14:03:23". Important! Order of format string options for DLF<дата + время> (DV or DDV) cannot be changed. DP (DE) - a string representing an empty date (for example, Format('00010101000000' ,"DP=""empty date""") will return the string "empty date"). BL (BF) is a string representing the logical value False. BI (BT) is a string representing the logical value True. Note. Using parameters for the input field: the DP (DE) parameter is not used; the DLF parameter is used only with the D (D), B (T) and DV (DT) values. Return value: Type: String. The string resulting from formatting the passed value. Description: Generates an easy-to-read representation of values. Useful for use in reports and other visual displays of values. Availability: Thin client, web client, server, thick client, external connection, 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 (C udan ) 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 Azerbaijan Chinese (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 (United Kingdom) 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 Administrative Region) , 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 (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-Rica) Es_Py Spanish (Paraguay) Es_SV Spanish (Salvador) Es_S Spanish (United States) 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 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 Guarati gu_IN Guarati (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 Kaza xsky 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 (Lithuanian) va) lv Latvian lv_LV Latvian (Latvia) mk Macedonian mk

Options:

<Значение>

The value to be formatted.

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

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

Formatting options are listed separated by the ";" symbol. The presence of a parameter means that the formatting differs 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 value (0 and 01/01/0001 00:00:00, respectively) will return an empty string.

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

Arbitrary characters can be specified inside the parameter value, which will be displayed as is when generating the resulting string. This way, for example, you can specify hour, minute, and second separators 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 - 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 rounded in accordance with the rounding rules. If this parameter is specified, then to display the fractional part of a number, it is necessary to specify the NPV parameter, otherwise the fractional part will not be displayed.
  • NDT - the number of decimal places in the fractional part. The original number is rounded in accordance with the rounding rules.
  • ES - shift of digits: 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.
  • CRD is a symbol separating the integer and fractional parts.
  • CHRG is a group separator symbol for an integer part of a number. If you use an empty string as a delimiter, then the delimiter will be a non-breaking space character.
  • CN is a string representing the zero value of a number. If not specified, then represented as an empty string. If "CHN=" is specified, then in the form of "0". Not used for numeric input fields.
  • CHN - whether leading zeros should be output. The value of this parameter is not specified; the presence of the parameter itself determines the output of leading zeros.
  • CHG - the order of grouping the digits of a number. The values ​​are numbers, 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, only the least significant digits will be grouped. If 0 is specified as the second number, then for all digits of the integer part of the number the value specified for the primary grouping will be applied. If a value other than 0 is used as the second number, then this value will be used to group all digits except the least significant ones already grouped.
  • СО - representation of negative numbers.
    • 0 (0) - a 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 numbers) without leading zero;
    • dd - day of the month (in numbers) 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 numbers) without leading zero;
    • MM - month number (in digits) with leading zero;
    • MMM - short name of the month;
    • MMMM - full name of the month;
    • k - number of the quarter in the year;
    • r - number of the year without a century and a leading zero;
    • yy - number of the year without a century with a leading zero;
    • yyyy - year number with century;
    • h - hour in the 12-hour version without leading zeros;
    • hh - hour in 12-hour clock with leading zero;
    • H - hour in 24-hour format without leading zeros;
    • HH (HH) - hour in 24-hour mode with a leading zero;
    • m - minute without leading zero;
    • mm - minute with leading zero;
    • s - second without a leading zero;
    • ss - second with leading zero;
    • bb - display half of the day AM/PM (valid only for configuration languages ​​that support the 12-hour time display option).
  • DLF - local date format. Specifies the option for displaying date parts.
    • D - date (in numbers);
    • DD - long date (month in words);
    • B - full time, date can be combined with time;
    • DV - date time.
  • DP - a string representing an empty date (for example, Format("00010101000000" ,"DP=""empty date""") will return the string "empty date").
  • BL - a string representing a Boolean value Lie.
  • BI - a string representing a logical value True.

*.cf- the file contains only the configuration (code and structure) without user data. Created from the 1C 8.x configurator: “Configuration -> Save configuration to file” or “Configuration -> Delivery configuration -> Create delivery file and update configuration -> attribute “Create delivery file””.

*.cfu- the file contains only a configuration update. For example file 1cv8.cfu. It is impossible to create a configuration from this file, since it only contains differences between the new configuration and the previous one. Created from the 1C 8.x configurator: “Configuration -> Configuration delivery -> Create delivery file and configuration update -> flag “Create configuration update file””.

*.dt- the file contains the configuration along with the user database. This is a specialized 1C 8 archive format. It is created from the 1C 8.x configurator: “Administration -> Upload infobase”.

*.epf (*.erf) – external processing (report) file. Any processing (report) from the configuration can be saved externally. Created from the 1C 8.x configurator: “Configuration -> Open configuration -> go to the desired processing (report) -> select with the right mouse button -> Save as external processing, report...”.

*.1cd– a full-fledged database file. Default name representation: 1Cv8.1CD. Includes configuration, database, user settings. Opens with the 1C 8.x platform. It is created to develop a new configuration automatically by clicking the “Add” button when selecting the “Creating a new information base” item.

*.log, *.lgf, *.lgp, *.elf- log files that collect information (register data) in 1C 8.0 8.1, 8.2, 8.3.

*. cdn - file with this extension ( 1Cv8.cdn) is used for manual or automatic blocking of the 1C Enterprise database eighth version.

*.mxl- files of printed forms are used, including in 1C. They are both printed forms of documents, reference books, reports, and various data storage devices for various classifiers. Opens through the Configurator or in 1C:Enterprise mode via “file -> open”. It is created in the same way: in Configurator mode or in 1C:Enterprise via “file -> new”. Also, files with such extensions can serve as transfer rules, for example, from 1C 7.7 to 8.2 (acc77_82.xml and auxiliary processing exp77_82.ert) - they are usually located in the ExtForms folder.

*.efd- this is a 1C archive file, used to install the configuration. Contains either the 1C configuration or an update to it. It is launched using the auxiliary executable file setup.exe (must be located in the same folder).

*.mft– auxiliary file for creating a configuration from a template. Contains configuration information, description, path, name. It is used directly by the platform itself when creating a 1C information base from a template.

*.grs- files of graphic diagrams in a specialized 1C format. Opens through the Configurator or in 1C:Enterprise mode via “file -> open”. It is created in the same way: in Configurator mode or in 1C:Enterprise via “file -> new”.

*.geo- files of geographical diagrams in a specialized 1C format. Opens through the Configurator or in 1C:Enterprise mode via “file -> open”. It is created in the same way: in Configurator mode or in 1C:Enterprise via “file -> new”.

*.st- text template files. Used mainly by 1C developers.

*.pff- a file with saved performance measurements. Used by system administrators and 1C specialists.

Detailed description. Click to expand

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

Formatting options are listed using the “;” symbol. The presence of a parameter means that the formatting differs 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 value (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 necessary if the parameter value contains characters used in format string syntax.

Arbitrary characters can be specified inside the parameter value, which will be displayed as is when generating the resulting string. This way, for example, you can specify hour, minute, and second separators 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 – name of the language, country for which standard formatting will be performed.
  • CN – the total number of displayed decimal places of the integer and fractional parts. The original number is rounded in accordance with the rounding rules. If this parameter is specified, then to display the fractional part of a number, it is necessary to specify the NPV parameter, otherwise the fractional part will not be displayed.
  • NDT is the number of decimal places in the fractional part. The original number is rounded in accordance with the rounding rules.
  • HS – shift of digits: 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 absolute value of the parameter.
  • CRD is a symbol separating the integer and fractional parts.
  • CHRG is a group separator symbol for an integer part of a number. If you use an empty string as a delimiter, then the delimiter will be a non-breaking space character.
  • CN is a string representing the zero value of a number. If not specified, then represented as an empty string. If “CHN=” is specified, then in the form “0”. Not used for numeric input fields.
  • CHN – whether leading zeros should be output. The value of this parameter is not specified; the presence of the parameter itself determines the output of leading zeros.
  • CHG – the order of grouping of digits of a number. The values ​​are numbers, 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, only the least significant digits will be grouped. If 0 is specified as the second number, then for all digits of the integer part of the number the value specified for the primary grouping will be applied. If a value other than 0 is used as the second number, then this value will be used to group all digits except the least significant ones already grouped.
  • СО – representation of negative numbers.
    • 0 (0) – string like “(1,1)”;
    • 1 (1) – a string like “-1,1”;
    • 2 (2) – a line like “- 1,1”;
    • 3 (3) – line of the form “1,1-“;
    • 4 (4) – a line of the form “1,1 -“.
  • DF – date format.
    • d – day of the month (in numbers) without leading zero;
    • dd – day of the month (in numbers) 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 numbers) without leading zero;
    • MM – month number (in digits) with leading zero;
    • MMM – short name of the month;
    • MMMM – full name of the month;
    • k – number of the quarter in the year;
    • g – year number without century and leading zero;
    • yy – number of the year without a century with a leading zero;
    • yyyy – year number with century;
    • h – hour in the 12-hour version without leading zeros;
    • hh – hour in the 12-hour version with a leading zero;
    • H – hour in 24-hour format without leading zeros;
    • HH (HH) – hour in 24-hour mode with a leading zero;
    • m – minute without leading zero;
    • mm – minute with leading zero;
    • s – second without a leading zero;
    • ss – second with leading zero;
    • bb – display half of the day AM/PM (valid only for configuration languages ​​that support the 12-hour time display option).
  • DLF – local date format. Specifies the option for displaying date parts.
    • 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"") will return the string "empty date."
  • BL – a string representing a logical value Lie.
  • BI – a string representing a logical value True.

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

Probably the most famous example is the different representation of time - in Russia it is common 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 representation of a value is called “format” and today we will discuss changing the date format and number format in 1C.
Formatting can be used either by a programmer in the 1C language or visually, without programming, for example, when creating a printed form or report, or when setting up elements on the form.

What is formatting

The number and date, regardless of its presentation on the screen or in print, remains itself. Formatting simply means converting it 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 the digits in a number by 3 (1,000,000, not 1,000,000)
  • date and time
    o order of year, month, day
    o delimiter character
    o 1C time format (12 or 24 hours)
    o writing details.

Also in the 1C format, additional “conveniences” may be indicated, for example, displaying negative numbers in red, or representing an “empty value” as “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 (is this what you expect?):
NumberString = AbbrLP(2400); //will be equal to “2 400”

To accurately indicate the format in the 1C language there is a Format() function, with which you can specify the required representation.
NumberString = Format(2400, “Settings”)

In the “Settings” line you need to specify the required 1C format. Such settings are indicated in a special encoded form. Let's look at the most commonly used settings:

Default 1C date and number format

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

L = Short Name of the Desired Country

An example of date output 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 notice, 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 independently specify the order of the date parts and the symbols for separating them, you must use the setting:
DF = "dmg chms"

Accordingly, “dmg” is the day, month and year, and “chms” is the hours, minutes and seconds. It is possible to skip any of these parts. The order is any. The characters specified between the parts will be used as separation characters.

The date part symbol can be specified several times in a row; the type of this date part depends on this, for example “d” or “dd” or “dddd”.

Explanation of date parts:

  • d – day
    o small "d"
  • M – month
    o big "M"
    o can be specified from 1 to 4 times
  • g – year
    o small "g"
    o can be specified 1 or 2 or 4 times
  • h – hours
    o small “h” – 12-hour format
    o large “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 – display AM/PM for 12-hour format
  • k – quarter.

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

Format(CurrentDate(), "DF="" M/d/yyyy h:m:s cc""")
> 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 formatting a date, where everything is quite simple, formatting a number has many options. 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 by 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 beautiful and understandable output to the user, but for service needs. This can be influenced using the “CHG” parameter, for example:

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

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

A parameter that allows you to round a number when outputting to the required number of digits after the decimal point “NFR”:

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

A parameter that allows you to specify the separator character for the integer and fractional parts of “BRD”:

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

In 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 do the “CHN” parameter:

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

Format 1C fields on the form

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

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

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

Click the "..." button to configure it. To configure the date format, use the Date tab (for numbers, use the Number tab). You can select the required format from the list.

1C cell format in printed form

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

1C format in SKD

SKD reports allow you to configure the 1C format both for the programmer (at the time of creating the report) and for the user (when using the report). There are also more possibilities due to the use of conditional formatting.

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

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

In the form that opens for all ACS settings, there is a “Conditional Formatting” tab. Add a new line. There are three columns in the line:

  • Decor. Specify the required 1C format - font, background or text color, 1C format for displaying numbers and dates
  • Condition. If you always use this design, then leave this field empty. Otherwise, specify the field and its value. Then formatting will be applied only to those rows in which these values ​​match. If you need to specify the values ​​of several fields at the same time and “and/or” conditions, add a group and group the fields using groups.
  • Formatted fields. List of fields to 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/Customize list”.

Conditional appearance tab.

Select the required design and format.

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