the Internet Windows Android

Presentation of the date in 1C English. Format string

The main types of data in 1C is the number, boolean and date, can be represented by many formats. Programmers are often faced with the fact that the requirements of the data type are greatly vary in different reports and tables. The 1C developers thought about the convenience of programmers and created a special function that would significantly facilitate the process of changing the appearance of the data. The main task of the function is to bring the number, date or logical type to the desired form of a string type.

Description of the function "Format"

The syntax of this feature is simple - you can transfer two parameters as parameters. First, the developer indicates the value that should be subjected to formatting. In order for 1C to understand how to change the value, the programmer specifies the second parameter as a string value containing predefined operands. It is the meaning of this string and determines which data will be displayed in the report.

Formatting \u003d format (varnaly formatting, text formattextrock);

If the "formameset" parameter is not specified, then 1C converts the specified value to the string. Remember that empty date and 0 will be converted to an empty string, which may not like to users. Each parameter in the format row is a combination of the name, the character "\u003d" and the values \u200b\u200bindicated in quotes. This allows you to impress the characters used in writing format string Functions format in 1C.

In the data display, you can insert an arbitrary symbol with the exception of the format lines used in the syntax. If there is a need to get around this limitation - use single quotes. This solution will also help in situations where the character can be interpreted with the compiler incorrectly.

For the convenience of developers in 1c, a format string designer is built. You can contact it in modules through context menu or in the SCD through the place provided by the developers. For example, this feature can be detected in the list of fields for the query in the "Design" section.

The most important advantage of the constructor is that you can immediately see how your data will look at the end. After you set the necessary settings for a specific type of data in the "Example" section, you demonstrate the result of your settings. In a unnamed text field at the bottom you will find a format string with which the result is obtained. It can be copied and used in the future if the result is fully arranged.

The format string designer can be a great help for novice developers, but experienced programmers prefer not to spend time on it. Development will be much faster if you know the main key options format parameters and use them without a constructor call.

The main parameters of the format string

Explore all available commands will not work, and this is not necessary. The developer is enough just to know some popular operations and how to apply them. At any time you can open the full list of parameters of the format string and select the desired one in the assistant syntax. The 1C programmer can use the following parameters in everyday operation:

  • L - the format of the country, for which the data will be displayed;
  • CG - sets the group of digits of the number;
  • CHC - establishes the total number of characters groups of the whole and fractional part of the number that will be displayed on view. If the value of the CDC parameter is not specified in the format row, the fractional part will not be shown;
  • CDC - a parameter defining the number of characters in the part after the comma. Rounding occurs in accordance with the standard rules of mathematics;
  • Emergencies - a parameter that shifters the discharges of the number. The value may be positive - multiplication by 10, or negative - division. Useful team if you need to be output in one form, and continue working with a number in another;
  • PSD - Specifies a symbol separating the fractional and integer part of the number. To set a symbol that shares the groups of the integer part, use "CHRG". For application inseparable blank Use an empty string;
  • CHVN - shows the use of leading zeros. The value of this parameter is not specified;
  • DF is one of the most common format string parameters. Manages the date format. In 1C using the "Format" command, you can display the date in almost any format, including writing the name of the month. There are many possible values, their list can be seen in the assistant syntax;
  • Bl and bi - set the view for logical type Data, responding, respectively, for lies and truth. Thus, the standard "tick" you can replace with any word or phrase, more intelligible for users.

The universalism and convenience of the designer became key causes of the popularity of the "Format" function among the developers 1C. Flexible settings help you ask any appearance Information on the request of the client.

Type: Number; Date; Booleo. Formatable value.<ФорматнаяСтрока> (Optional) Type: Row. The format string is a string value that includes formatting parameters. Formatting parameters are listed through the ";" symbol. The presence of a parameter means the difference between the formatting from the standard one. If the parameter is not specified, the standard formatting is applied, which basically corresponds to the conversion of the value to the string. However, for the values \u200b\u200bof the type and the default date (0 and 01.0001, 00:00:00, respectively) an empty string will be issued. Each parameter is set by the parameter name, the "\u003d" symbol and the value of the parameter. The parameter value may be indicated in single or double quotes . This is necessary if the value of the parameter contains the characters used in the syntax of the format string. Inside the value of the parameter, arbitrary characters may be indicated, which when generating the resulting string will be displayed as it is. Thus, for example, you can specify clock separators, minutes and seconds when formatting time. If these characters are coincided with the values \u200b\u200bof the format lines, they must be concluded in single quotes. Names and values \u200b\u200bof the parameters of the format string: L (L) - the name of the language, the country for which standard formatting will be performed. Available language names are located after describing the format lines. CHC (ND) is the total number of decimal discharges of the whole and fractional parts. The initial number is rounded in accordance with the Rules of Rounding OKR15KAK20. If this parameter is specified, then to display the fractional part of the number, it is necessary to specify the CDC parameter, otherwise the fractional part will not be displayed. CDC (NFD) is the number of decimal discharges in the fractional part. The initial number is rounded in accordance with the Rules of Rounding OKR15KAK20. Emergencies (NS) - Discharge shift: Positive - division, negative - multiplication. In other words, this means that the initial number will be multiplied or divided by 10 * C, where C is the value of the module parameter. PSD (NDS) - Symbol-separator of the whole and fractional part. ЧHG (NGS) is a symbol-separator of groups of the whole number. If you use an empty string as a separator, then in this case the separator will be a symbol of an inseparable space. CN (NZ) - a string representing the zero value of the number. If not specified, the representation in the form of an empty string. If "CN \u003d" is specified, then in the form "0". Not used for numeric input fields. CHVN (NLZ) - whether to remove the leading zeros. The value of this parameter is not specified, the result of the parameter determines the output of the leading zeros. CG (NG) is the order of grouping of the number of numbers. As a value, numbers are indicated, through the comma, denoting the number of grouped discharges to the right left. It makes sense only the first two numbers. The first of them indicates the primary grouping, that is, the one that will be used for the least significant discharges of the whole part of the number. If the second number is not specified, only the least significant discharges will be grouped. If 0 is set as a second number, then the value specified for the primary group will be applied for all categories of the number. If a value other than 0 is used as a second number, this value will be used to group all discharges, except for the already grouped least significant. Cho (NN) - representation of negative numbers. 0 (0) - the string of the type "(1,1)"; 1 (1) - a string of the type "-1,1"; 2 (2) - a string of the type "- 1,1"; 3 (3) - a string of the form "1,1-"; 4 (4) - a string of the type "1.1 -". DF (DF) - date format. d (d) - day of the month (numbers) without a leading zero; DD (DD) - day of the month (numbers) with a leading zero; DDD (DDD) - short name day of the week *); DDDD (DDDD) - the full name of the day of the week *); M (m) - number of the month (numbers) without a leading zero; Mm (mm) - number of month (numbers) with a leading zero; MMM (MMM) - a short name of the month *); MMMM (MMMM) - the full name of the month *); K (Q) - the quarter number in the year; g (y) - number of the year without a century and leading zero; GG (YY) - number of the year without a century with a leading zero; yyyy (yyyy) - number of the year since the century; h (h) - an hour at 12 o'clock without leading zeros; CC (HH) - an hour at 12 o'clock with a leading zero; H (h) - an hour in 24 hour variant without leading zeros; CC (HH) - an hour in 24 hour variant with the leading zero; m (m) - a minute without a leading zero; mm (mm) - minute with a leading zero; with (s) - second without a leading zero; SS (SS) - second with a leading zero; BB (TT) - Displays half of the day AM / PM (valid only for configuration languages \u200b\u200bthat support the 12-hour version of the time representation). Note: *) - not used for the format line of the date input field. DLF (DLF) - Local date format. This indicates the display of the dates parts. D (d) - date (numbers); DD (DD) - long date (month in words); In (t) - the total time, the date can be combined with time; DV (DT) - date time. Example: Expression Format ('20051120140323', "DLF \u003d DDV") matters "November 20, 2005 14:03:23". Important! The order of the format string options for DLF<дата + время> (DV or DDV) cannot be changed. DP (DE) is a string representing an empty date (for example, the format ('00010101000000', "dp \u003d" "empty date" ") will return the" empty date "line). BL (BF) - a string representing the logical value of the lie. BI (BT) - a string representing the logical value of truth. Note. Using parameters for input field: DP parameter (DE) is not used; The DLF parameter (DLF) is used only with the values \u200b\u200bof D (D), in (T) and DV (DT). Return value: Type: Row. The string obtained as a result of formatting the transmitted value. Description: Forms a convenient to read the presentation of values. Useful use in reports and with other visual display of values. Availability: Slim 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) AMKAR AM_ET Amkha (Ethiopia) Arab Arab AR_AE Arabic (United Arab Emirates) AR_BH Arabic (Bahrain) AR_DZ Arabic (Algeri) 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 Assam AS_IN Assam (India) AZ Azerbaijani AZ_AZ Azerbaijani (Azerbaijan) AZ_CYRL Azerbaijani (Cyrillic) AZ_CYRL_AZ Azerbaijani (Cyrillic, Azerbaijan) AZ_LATN Azerbaijani Azerbaijani ( Latina, Azerbaijan) Be Belarusian BE_BY Belarusian (Belarus) BG Bulgarian BG_BG Bulgarian (Bulgaria) BN Bengali BN_IN Bengali (India) CA Catalansky CA_ES Catalan Ki (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 ) EN_CA English (Canada) EN_GB English (United Kingdom) EN_HK English (Hong Kong, (area with special administrative control, 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) en_vi English (American 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 (Salvador) ES_US Spanish (United States of America) ES_UY Spanish (Uruguay) ES_VE Spanish (Venezuell) 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 FERERSKY FO_FO FARERSKIY (FAREERSKY) FR French Sky 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 Galiysk Gl_es, Galician (Spain) Gu_in Gu_in Guyraja (India) He_il He_IL He_in (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) Japanese Japanese Ja_JP Japanese (Japan) KA Georgian KA_GE Georgian (Georgia) KK Kazakh KK_KZ Kazakh (Kazakhstan) KL Greenland KL_GL Greenland (Greenland) KNanada KN_IN Kannada (India) Ko Korean Ko_Kr Korean (South Korea) Kok Kokny Kok_in Concani (ind Iya) KY Kyrgyz Ky_ky Kyrgyz (Kyrgyz) Lt Lithuanian LT_LT Lithuanian (Lithuania) LV Latvian LV_LV Latvian (Latvia) MK Macedonian MK_MK Macedonian (Macedonia) ML Malaylam ML_IN Malayalam (India) MS MAR_IN MS_BN Malay (Brunei ) MS_MY Malay (Malaysia) MT Maltese MT_MT Maltese (Malta) NB Norwegian Bookmaker NB_NO Norwegian Bookmol (Norway) NL Dutch NL_BE Dutch (Belgium) NL_NL Dutch (Netherlands) NN Norwegian Nünorsk NN_NO Norwegian Nyunorsk (Norway) OM OROMO (AFAN) OM_ET OROMO (AFAN) (Ethiopia) OM_KE OROMO (AFAN) (Kenya) or Ouri Ouri Ouri (India) PA PA_IN PA_IN PLABA (India) PL Polish PL_PL Polish (Poland) PS PASTO (Pushto) PS_AF PASTO (Pushto) (Afghanistan) PT Portuguese Pt_br Portuguese (Brazil) PT_PT Portuguese (Portugal) RO Romanian Ro_ro Romanian (Romania) EN Russian RU_RU Russian (Russia) R

Embedded Language Functions. Format (Script Functions.format)
Built-in Language Features (Script Functions)
Format (Format)
Syntax:
Format(<Значение>, <ФорматнаяСтрока>
Parameters:
<Значение> (mandatory)
Type: Number; Date; Booleo. Formatable value.
<ФорматнаяСтрока> (optional)
Type: Row. The format string is a string value that includes formatting parameters.
Formatting parameters are listed through the ";" symbol. The presence of a parameter means the difference between the formatting from the standard one.
If the parameter is not specified, the standard formatting is applied, which basically corresponds to the conversion of the value to the string. However, for the values \u200b\u200bof the type and the default date (0 and 01.0001, 00:00:00, respectively) an empty string will be issued.
Each parameter is set by the parameter name, the "\u003d" symbol and the value of the parameter. The parameter value may be indicated in single or double quotes. This is necessary if the value of the parameter contains the characters used in the syntax of the format string. Inside the value of the parameter, arbitrary characters may be indicated, which when generating the resulting string will be displayed as it is. Thus, for example, you can specify clock separators, minutes and seconds when formatting time. If these characters coincide with the values \u200b\u200bof the format row, they must be concluded in single quotes.
Names and values \u200b\u200bof the parameters of the format string:
L (L) is the name of the language, the countries for which standard formatting will be performed. Available Languages \u200b\u200bNames:
aF Afrikaans
aF_ZA Afrikaans (South Africa)
am Amharsky
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 Assamsky
aS_IN Assam (India)
aZ Azerbaijani
aZ_AZ Azerbaijani (Azerbaijan)
aZ_CYRL Azerbaijani (Cyrillic)
aZ_CYRL_AZ Azerbaijani (Cyrillic, Azerbaijan)
aZ_LATN Azerbaijani (Latina)
aZ_LATN_AZ Azerbaijani (Latina, Azerbaijan)
be Belarusian
bE_BY Belarusian (Belarus)
bG Bulgarian
bG_BG Bulgarian (Bulgaria)
bN Bengalsky
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 Dansky
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 (United Kingdom)
eN_HK English (Hong Kong, (area with special administrative management, 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 (American 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 (Salvador)
eS_US Spanish (United States of America)
eS_UY Spanish (Uruguay)
eS_VE Spanish (Venezuell)
et Estonian
eT_EE Estonian (Estonia)
eU Basque
eU_ES Basque (Spain)
fa Persian
fA_AF Persian (Afghanistan)
fA_IR Persian (Iran)
fi Finnish
fIFI Finnish (Finland)
fo Fariere
fo_fo Faroe (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 Guyarati
gu_in Guyarati (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)
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 Greenland
kL_GL Greenland (Greenland)
kN Kannada
kn_in Cannada (India)
ko Korean
ko_Kr Korean (South Korea)
kok Konkani.
kok_in Concani (India)
lT Litovsky
lT_LT Lithuanian (Lithuania)
lV Latvian
lV_LV Latvian (Latvia)
mK Macedonian
mK_MK Macedonian (Macedonia)
mL Malayalam
mL_IN Malayalam (India)
mR MARATIY
mR_IN MARATEY (India)
mS Malay
mS_BN Malay (Brunei)
mS_MY Malay (Malaysia)
mT Maltese
mT_MT Maltese (Malta)
nB Norwegian Bookmol
nB_NO Norwegian Bookmol (Norway)
nL Dutch
nL_BE Dutch (Belgium)
nL_NL Dutch (Netherlands)
nN Norwegian Nyunorsk
nN_NO Norwegian Nyunorsk (Norway)
oM OROMO (AFAN)
om_et oromo (AFAN) (Ethiopia)
oM_KE Oromo (AFAN) (Kenya)
or Ouri.
or_in Ouri (India)
pA Padjabsky
pA_IN Panjabsky (India)
pL Polish
pL_PL Polish (Poland)
pS PASHTO (Pashto)
pS_AF Pashto (Pashto) (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 (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_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 (Latina, Serbia and Montenegro)
sR_LATN_YU Serbian (Latina, Yugoslavia)
sR_YU Serbian (Yugoslavia)
sV Swedish
sV_FI Swedish (Finland)
sV_SE Swedish (Sweden)
sW Suakhili
sW_KE Swahili (Swahili)
sW_TZ Suakhili (Tanzania)
ta Tamilsky
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 (Latina, 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 (area with special administrative management, China))
zH_HANT_MO Chinese (Hant, Macau (area with special administrative management, China))
zH_HANT_TW Chinese (Hant, Taiwan)
zH_HK Chinese (Hong Kong (area with special administrative management, China))
zH_MO Chinese (Macau (area with special administrative control, China))
zH_SG Chinese (Singapore)
zH_TW Chinese (Taiwan)
CHC (ND) is the total number of decimal discharges of the whole and fractional parts. The initial number is rounded in accordance with the Rules of Rounding OKR15KAK20. If this parameter is specified, then to display the fractional part of the number, it is necessary to specify the CDC parameter, otherwise the fractional part will not be displayed.
CDC (NFD) is the number of decimal discharges in the fractional part. The initial number is rounded in accordance with the Rules of Rounding OKR15KAK20.
Emergencies (NS) - Discharge shift: Positive - division, negative - multiplication. In other words, this means that the initial number will be multiplied or divided by 10 * C, where C is the value of the module parameter.
PSD (NDS) - Symbol-separator of the whole and fractional part.
ЧHG (NGS) is a symbol-separator of groups of the whole number. If you use an empty string as a separator, then in this case the separator will be a symbol of an inseparable space.
CN (NZ) - a string representing the zero value of the number. If not specified, the representation in the form of an empty string. If "CN \u003d" is specified, then in the form "0". Not used for numeric input fields.
CHVN (NLZ) - whether to remove the leading zeros. The value of this parameter is not specified, the result of the parameter determines the output of the leading zeros.
CG (NG) is the order of grouping of the number of numbers. As a value, numbers are indicated, through the comma, denoting the number of grouped discharges to the right left. To indicate that the last number of grouping should be repeated for all senior discharges, then after it is indicated by 0.
Cho (NN) - representation of negative numbers.
0 - line of type "(1,1)";
1 - line of type "-1.1";
2 - a string of the form "- 1.1";
3 - a string of the form "1,1-";
4 - Line of the type "1,1 -".
DF (DF) - date format.
d (d) - day of the month (numbers) without a leading zero;
dD (DD) - day of the month (numbers) with a leading zero;
dDD (DDD) - the short name of the day of the week *);
dDDD (DDDD) - the full name of the day of the week *);
M (m) - number of the month (numbers) without a leading zero;
Mm (mm) - number of month (numbers) with a leading zero;
MMM (MMM) - a short name of the month *);
MMMM (MMMM) - the full name of the month *);
k (Q) - the quarter number in the year;
g (y) - number of the year without a century and leading zero;
gG (YY) - number of the year without a century with a leading zero;
yyyy (yyyy) - number of the year since the century;
h (h) - an hour at 12 o'clock without leading zeros;
cC (HH) - an hour at 12 o'clock with a leading zero;
H (h) - an hour in 24 hour variant without leading zeros;
CC (HH) - an hour in 24 hour variant with the leading zero;
m (m) - a minute without a leading zero;
mm (mm) - minute with a leading zero;
with (s) - second without a leading zero;
sS (SS) - second with a leading zero;
bB (TT) - Displays half of the day AM / PM (valid only for configuration languages \u200b\u200bthat support the 12-hour version of the time representation).
Note: *) - not used for the format line of the date input field.
DLF (DLF) - Local date format. This indicates the display of the dates parts.
D (d) - date (numbers);
DD (DD) - long date (month in words);
In (t) - the total time, the date can be combined with time;
DV (DT) - date time.
Example: Expression Format ("20051120140323", "DLF \u003d DDV") matters "November 20, 2005 14:03:23".
Important! The order of the format string options for DLF<дата + время> (DV or DDV) cannot be changed.
DP (DE) is a string representing an empty date (for example, the format ("00010101000000", "dp \u003d" "empty date" ") will return the string" empty date ").
BL (BF) - a string representing the logical value of the lie.
BI (BT) - a string representing the logical value of truth.
Note. Using parameters for input field: DP parameter (DE) is not used; The DLF parameter (DLF) is used only with the values \u200b\u200bof D (D), in (T) and DV (DT).
Return value:
Type: Row. The string obtained as a result of formatting the transmitted value.
Description:
Forms a convenient reading representation of values. Useful use in reports and with other visual display of values.

Availability:
Slim client, web client, server, external connection.
Example:
// Examples of formatting numbers
A \u003d format (123456.789, "CHC \u003d 10; CDC \u003d 2");
// A \u003d "123 456.79"
A \u003d format (123456.789, "ChRD \u003d" - "");
// A \u003d "123 456-789"
A \u003d format (-123456.789, "Cho \u003d 0");
// A \u003d "(123 456.789)";

// Date formatting examples
A \u003d format ("20020820153309", "DF \u003d" "DD MMMM GGYGG" G. "HCH: mm: ss" ");
// A \u003d "August 20, 2002 15:33:09"
A \u003d format ("20020820153309", "DF \u003d" "DD / MM-GGGG" ");
// A \u003d "20 / 08-2002"
A \u003d format ("20020820153309", "DLF \u003d DD");
// A \u003d "August 20, 2002";
A \u003d format ("20020820153309", "DLF \u003d D");
// A \u003d "20.08.2002";
A \u003d format ("20020820153309", "DLF \u003d B");
// A \u003d "15:33:09";

// Formatting examples logic expressions
A \u003d format (truth, "bl \u003d is missing; bi \u003d available");
// A \u003d "Available";

Programming (and business programs) usually deal with the following simple data types: Number, line, date. Values \u200b\u200bof these types for different countries, standards and simply habits can have a different presentation.

Probably the most famous example is a different presentation of time - in Russia 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 24x hour) and writing.

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

What is formatting

The number and date regardless of its presentation on the screen or on the seal - remains itself. Formatting implies exclusively converting to a string value - that is, how it will "look" on the computer screen or on paper.

The main differences in the formats 1C representation of numbers and dates:

  • Number
    o "." or "," for the separation of the fractional part
    o Number of semicolons
    o Grouping numbers Among 3 (1 000 000, and not 10,000,000)
  • date and time
    o order of year, month, day
    o Symbol-separator
    o 1s time format (12 or 24 hours)
    o writing details.

Also in 1C format, additional "convenience" can be indicated, for example, negative numbers output red, or the "empty value" representation in the form "0" or "not filled".

Formatting principle

Formatting by default works, for example, when translating a number into a string. In some cases, such settings can serve as a bad service where the programmer does not expect this programmer.

For example, when translating the number in the string, it is translated to the grouping of the numbers (and you expect this?):
Number-frame \u003d CROLP (2400); // will be "2,400"

To accurately specify the 1C format, there is a format () function, with which it is possible to specify the desired view.
Number-frame \u003d Format (2400, "Settings")

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

Format 1C dates and default numbers

If you need to withdraw a date or number and do not want to bother with knowledge, how they should be presented according to the rules of the required country, there are simplest settingwhich will allow you to do it:

L \u003d short-natal-monopolisy

An example of the output of the date according to the rules of some countries:
Format (currentData (), "L \u003d RU")
> 28.03.2012 14:21:32

Format (currentData (), "L \u003d EN")
\u003e 3/28/2012 2:21:24 pm

Format (currentData (), "L \u003d FR")
> 28/03/2012 14:22:08

It is not difficult to notice, the names of countries are intuitive.

Date format in Language 1C

If the default settings are not enough and I would like to independently specify the order of parts of the date and the symbols of their separation, you must use the setting:
DF \u003d "DMG HRS"

Accordingly, DMG is a day, month and year, and the "CHMS" is a watch, minutes and seconds. You can skip any of these parts. The order of following is any. The characters specified between the parts will be used as separation symbols.

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

Decryption of dates parts:

  • d - day
    o Little "D"
  • M - Month
    o big "m"
    o can be indicated from 1 to 4 times
  • g - year
    o Little "g"
    o can be specified 1 or 2 or 4 times
  • h - watch
    o Little "h" - 12 watch format
    o big "h" - 24x hour format
  • m - Minutes
    o Little "M"
    o can be specified 1 or 2 times
  • c - seconds
    o Little "C"
    o can be specified 1 or 2 times
  • bB - AM / PM mapping for 12 hour format
  • by - quarter.

An example of the output of the date indicating the rules:
Format (currentData (), "DF \u003d" "DD.MM.YYYY HCH: mm: ss" ")
> 28.03.2012 02:44:44

Format (currentDATA (), "DF \u003d" "M / D / GGGH H: M: from BB" ")
\u003e 3/28/2012 2:44:44 pm

Format (Current Data (), "DF \u003d" "DD / MM / GGGH HCH: mm: ss" ")
> 28/03/2012 02:44:44

The format of the number in Language 1C
In contrast to the date formatting, where everything is simple enough, there are many parameters for formatting a number. We will consider those that seemed useful to us - that is, in our opinion, often apply.

The first "problem" is associated with the default grouping of numbers in numbers 3 and the division of groups by a space, for example:
Stroscle \u003d Row (22300500)
> 22 300 500

This is inconvenient when the number is transformed into a string not for a beautiful and understandable output to the user, but for official needs. This can be affected by the "CHG" parameter, for example:

Format (22300500, "CG \u003d 100")
\u003e 22300500 // Long removed zeros

Format (22300500, "CG \u003d 6")
\u003e 22 300500 // made a group of only millions

The parameter that allows you to round the number when displaying to the desired number of numbers after the Switch "CDC":

Format (3.535353, "CDC \u003d" "2" ")
> 3,54

The parameter that allows you to specify the symbol-separator of the whole and fractional part "PSD":

Format (3.535353, "ChRD \u003d" "." "")
> 3.535353

For some cases it is 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 "CN" parameter:

Format (0, "CN \u003d" "" "")
>

Format 1C field on format

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

For example, the user works with a form. On the form there is a field that displays the date. We can affect the presentation of this date.

Open the properties of this field. To do this, in the Tolstaya Client, right-click on the field, and in the thin button on the field name in the field list, select Properties.
The field has a "format" property.

Click the "..." button to configure it. To configure the date format, use the date tab (for the number - the number bookmark). You can select the desired format from the list.

1C Cell format in print format

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

1c format in SKD

CC reports allow you to configure 1C format as a programmer (at the time of the report) and the user (when using the report). Also more than the use of conventional formatting.

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

In the Enterprise mode, select the menu item on the "Modify option" report. In the CCD report in the Tolstaya Client, this item in the Actions / Settings menu.

In the form of all sCD settings There is a conditional formatting tab. Add a new line. In the line three columns:

  • Registration. Specify the desired 1c format - font, background color, or text format 1C Display of the number and date
  • Condition. If this design is always applied - then leave this field empty. Otherwise, specify the field and its value. Then formatting will be applied only in those lines in which these values \u200b\u200bcoincide. If you want to specify the values \u200b\u200bof multiple fields at the same time and the conditions "and / or" - add a group and grouped the fields using groups.
  • Fields decorated. List of fields for which formatting will be applied.

1c format in managed forms

Similar formatting rules operate in any form of a managed client list. In the list form, select the menu item "All Actions / Configure List".

Laying conditional design.

Select the desired design and format.

We specify a list of fields to which this design will be applied.