The number in words is 1s. Number in words, detailed description. Description of working with the function

Code 1C v 8.x
// An example of a format string for displaying a number in words in Russian
// language, with the output of the integer and fractional parts in words and output
// subject of calculus.
FormString = "L = ru_RU; DP = True";
ItemPar="dollar,dollar,dollars,m,cent,cent,cents,m,2";
Numbers in Words = Number in Words(2341.56, FormString, ItemPart);
// Calculation result: "Two thousand three hundred forty-one dollars fifty-six cents"

NumberIn words(Number, Format string, Calculus subject parameters)

Number - The number that needs to be converted to a string in words.

A format string is a string value that includes formatting options. Formatting options are listed separated by the ";" symbol. (semicolon). If a parameter is not specified, the parameter's default value is used.
Each parameter is specified by the parameter name, the "=" (equals) symbol, and the value of the parameter. 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.
L (L) - Localization code. The default localization code is set to operating system. Examples of localization codes: ru_RU - Russian (Russia); en_US - English (USA).
NP (SN) - Include/do not include the name of the subject of calculus (Boolean), default - True.
ND (FN) - Include/do not include the name of the decimal parts of the subject of calculus (Boolean), by default - True.
DP (FS) - Display the fractional part in words/numbers (Boolean), by default - False.

Calculus subject parameters - Represents a string value that defines the parameters of the calculus subject. Calculus subject parameters are listed separated by "," (comma). The string format depends on the localization code.
For Russian and Belarusian languages ​​(ru_RU, be_BY)
"ruble, ruble, ruble, m, kopeck, kopeck, kopeck, w, 2", where:
“ruble, ruble, rubles, m” – subject of calculation:
ruble – singular nominative case,
ruble – singular genitive case,
rubles – plural genitive case,


For Ukrainian language (uk_UA)
"hryvnia, hryvnia, hryvnia, m, kopeck, kopeck, kopeck, w, 2", where:
“hryvnia, hryvnia, hryvnia, m” – subject of calculation:
"hryvnia – singular nominative case,
hryvnia – singular genitive case,
hryvnia – plural genitive case,
m – masculine (w – feminine, s – neuter);
“kopeck, kopeck, kopeck, zh” – fractional part, similar to the subject of calculus (may be absent);
"2" – number of digits of the fractional part (may be absent, default is 2).
For Polish (pl_PL)
z?oty, z?ote, z?otych, m, grosz, grosze, groszy, m, 2
Where:
"z?oty, z?ote, z?otych, m" - subject of calculation (m - masculine, ? - feminine, ? - neuter, mo - personal masculine)
z?oty - singular nominative case
z?ote - singular accusative
z?otych - plural accusative
m - masculine (? - feminine, ? - neuter, mo - personal masculine)
"grosz, grosze, groszy, m" - fractional part (may be absent) (similar to the integer part)
2 - number of digits of the fractional part (may be absent, default is 2)
Code 1C v 8.x
In words = NumberIn words(1832, “L=pl_PL;SN=true;FN=true;FS=true”, “z?oty, z?ote, z?otych, m, grosz, grosze, groszy, m, 2”) ;

For English, Finnish and Kazakh languages ​​(en_US, fi_FI, kk_KZ)
"dollar, dollars, cent, cents, 2", where:
"dollar, dollars" – subject of calculation in singular and plural;
"cent, cents" – fractional part in singular and plural (may be absent);
"2" – number of digits of the fractional part (may be absent, default is 2).
For German (de_DE)
"EURO, EURO, M, Cent, Cent, M, 2", where:
"EURO, EURO, M" – subject of calculation:
EURO, EURO – subject of calculation in singular and plural;
M – masculine (F – feminine, N – neuter);
“Cent, Cent, M” – fractional part, similar to the subject of calculus (may be absent);
"2" – number of digits of the fractional part (may be absent, default is 2).

Examples:
Code 1C v 8.x x = Number in words (123456.78,"DP=True","ton, tons, tons, f, kg., kg., kg., m, 3");
//x = "One hundred twenty-three thousand four hundred fifty-six tons seven hundred eighty kg."

X = NumberIn Word(123456.78,",0");
//x = "One hundred twenty-three thousand four hundred fifty-seven"

X = NumberIn Word(123456.78,",2");
//x = "One hundred twenty-three thousand four hundred fifty-six 78 "

X = NumberIn words(123456.78,"L=ru_RU; DP=False","ruble, ruble, rubles, m, kopeck, kopeck, kopeck, w");
//x = "One hundred twenty-three thousand four hundred fifty-six rubles 78 kopecks"

X = NumberIn Words(123456.78, "L = ru_RU; DP = True", "dollar,dollar,dollars,m,cent,cent,cents,m,2");
//x = "One hundred twenty-three thousand four hundred fifty-six dollars seventy-eight cents"

NumberIn words(1457.25,"L=en_US","dollar, dollars, cent, cents, 2");
// One thousand four hundred fifty seven dollars 25 cents.

Code 1C v 8.x
// An example of a format string for displaying a number in words in Russian
// language, with the output of the integer and fractional parts in words and output
// subject of calculus.
FormString = "L = ru_RU; DP = True";
ItemPar="dollar,dollar,dollars,m,cent,cent,cents,m,2";
Numbers in Words = Number in Words(2341.56, FormString, ItemPart);
// Calculation result: "Two thousand three hundred forty-one dollars fifty-six cents"

NumberIn words(Number, Format string, Calculus subject parameters)

Number - The number that needs to be converted to a string in words.

A format string is a string value that includes formatting options. Formatting options are listed separated by the ";" symbol. (semicolon). If a parameter is not specified, the parameter's default value is used.
Each parameter is specified by the parameter name, the "=" (equals) symbol, and the value of the parameter. 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.
L (L) - Localization code. By default, the localization code installed in the operating system is used. Examples of localization codes: ru_RU - Russian (Russia); en_US - English (USA).
NP (SN) - Include/do not include the name of the subject of calculus (Boolean), default - True.
ND (FN) - Include/do not include the name of the decimal parts of the subject of calculus (Boolean), by default - True.
DP (FS) - Display the fractional part in words/numbers (Boolean), by default - False.

Calculus subject parameters - Represents a string value that defines the parameters of the calculus subject. Calculus subject parameters are listed separated by "," (comma). The string format depends on the localization code.
For Russian and Belarusian languages ​​(ru_RU, be_BY)
"ruble, ruble, ruble, m, kopeck, kopeck, kopeck, w, 2", where:
"ruble, ruble, rubles, m" - subject of calculation:
ruble - singular nominative case,
ruble - singular genitive case,
rubles - plural genitive case,



For Ukrainian language (uk_UA)
"hryvnia, hryvnia, hryvnia, m, kopeck, kopeck, kopeck, w, 2", where:
"hryvnia, hryvnia, hryvnia, m" - subject of calculation:
"hryvnia - singular nominative case,
hryvnia - singular genitive case,
hryvnia - plural genitive case,
m - masculine (w - feminine, s - neuter);
“kopeck, kopeck, kopeck, zh” - fractional part, similar to the subject of calculus (may be absent);
"2" - the number of digits of the fractional part (may be absent, default is 2).
For Polish (pl_PL)
z?oty, z?ote, z?otych, m, grosz, grosze, groszy, m, 2
Where:
"z?oty, z?ote, z?otych, m" - subject of calculation (m - masculine, ? - feminine, ? - neuter, mo - personal masculine)
z?oty - singular nominative case
z?ote - singular accusative
z?otych - plural accusative
m - masculine (? - feminine, ? - neuter, mo - personal masculine)
"grosz, grosze, groszy, m" - fractional part (may be absent) (similar to the integer part)
2 - number of digits of the fractional part (may be absent, default is 2)
Code 1C v 8.x
In words = NumberIn words(1832, “L=pl_PL;SN=true;FN=true;FS=true”, “z?oty, z?ote, z?otych, m, grosz, grosze, groszy, m, 2”) ;

For English, Finnish and Kazakh languages ​​(en_US, fi_FI, kk_KZ)
"dollar, dollars, cent, cents, 2", where:
"dollar, dollars" - subject of calculation in singular and plural;
"cent, cents" - fractional part in singular and plural (may be absent);
"2" - the number of digits of the fractional part (may be absent, default is 2).
For German (de_DE)
"EURO, EURO, M, Cent, Cent, M, 2", where:
"EURO, EURO, M" - subject of calculation:
EURO, EURO - subject of calculation in singular and plural;
M - masculine (F - feminine, N - neuter);
"Cent, Cent, M" - fractional part, similar to the subject of calculus (may be absent);
"2" - the number of digits of the fractional part (may be absent, default is 2).

Examples:
Code 1C v 8.x x = Number in words (123456.78,"DP=True","ton, tons, tons, f, kg., kg., kg., m, 3");
//x = "One hundred twenty-three thousand four hundred fifty-six tons seven hundred eighty kg."

X = NumberIn Word(123456.78,",0");
//x = "One hundred twenty-three thousand four hundred fifty-seven"

X = NumberIn Word(123456.78,",2");
//x = "One hundred twenty-three thousand four hundred fifty-six 78 "

X = NumberIn words(123456.78,"L=ru_RU; DP=False","ruble, ruble, rubles, m, kopeck, kopeck, kopeck, w");
//x = "One hundred twenty-three thousand four hundred fifty-six rubles 78 kopecks"

X = NumberIn Words(123456.78, "L = ru_RU; DP = True", "dollar,dollar,dollars,m,cent,cent,cents,m,2");
//x = "One hundred twenty-three thousand four hundred fifty-six dollars seventy-eight cents"

Information taken from the site

When displaying various reports, it is often necessary to convert a numeric value into a string in words. In 1C this is solved very simply: the function NumberInWord() is provided for this.

When forming a number in words, it is possible to display next to it the subject of calculation of this number in the required gender and case. Subject of calculus- this is what the converted number measures, for example, money, boxes, carriages, televisions, etc.

  • Without the subject of calculus:
    • Twenty two;
    • Three hundred eighty four.
  • With the subject of calculus:
    • Thirty-eight doubloons;
    • Twelve ships;
    • Two houses.

Examples

First, let's give examples of conversion to find out the capabilities of 1C:

// ***** Output numbers: ***** NumberIn Words(9876.54); // Nine thousand eight hundred seventy six 54 NumberIn words (1234.56, "L=ru_RU;DP=TRUE" , "whole, whole, whole, f, hundredth, hundredth, hundredth, f, 2"); // One thousand two hundred thirty-four point fifty-six hundredths NumberIn words (7432, "L=ru_RU;NP=False" , ",0" ); // Seven thousand four hundred thirty two // ***** Withdrawal of funds: ***** NumberIn words (9845.11, "Л=ru_RU" , ); // Nine thousand eight hundred forty-five rubles 11 kopecks Number in words (2845.11, "L=ru_RU;DP=True" , "ruble, ruble, ruble, m, kopeck, kopeck, kopeck, w, 2"); // Two thousand eight hundred forty-five rubles eleven kopecks Number in words (555.16, "L=ru_RU;DP=True" , "dollar, dollar, dollars, m, cent, cent, cents, m, 2"); // Five hundred fifty-five dollars sixteen cents Number in words (453.23, "L=ru_RU;DP=True" , "euro, euro, euro, m, cent, cent, cents, m, 2"); // Four hundred fifty-three euros twenty-three cents NumberIn Words (812.44, "L=en_US;DP=True" , "dollar, dollars, cent, cents, 2"); // Eight hundred twelve dollars forty four cents NumberIn Words (3945.76, "L=en_US;DP=True" , ​​"euro, euros, cent, cents, 2" ); // Three thousand nine hundred forty five euros seventy six cents // ***** You can convert not only monetary units: ***** Number in words (535 , "Л=ru_RU" , "box, boxes, boxes, w, w, 0"); // Five hundred thirty-five boxes Number in words (342 , "Л=ru_RU" , "TV, TV, TVs, m, m, 0"); // Three hundred forty-two TVs

Description of working with the function

As we found out, to get a number in words, use the function

NumberIn words (< Число >, < FormatString>, < Item ParametersCalculus>)

The function returns a string value. The following are passed as input parameters:

  • Number is the value to be converted;
  • FormatString - formatting options:
    • L — Localization code (for example, u_RU — Russian; en_US — English, de_DE — German). By default, the operating system settings are used.
    • NP - Display the name of the subject of calculus, by default - True.
    • ND - Display the name of the decimal parts of the subject of calculus, by default - True.
    • DP - Display the fractional part in words/numbers, default - False.
    • AI - Deduce the conjunction and. Analyzed only for English localization. Possible values: “Not Use”, “Use”.
  • Calculus Subject Parameters - comma-separated listing of the parameters of a calculus subject. The format depends on the localization.

For the Russian language, the parameters of the subject of calculus have the form “ruble, ruble, rubles, m, kopeck, kopecks, kopecks, zh, 2”, where:

  • ruble – singular nominative case;
  • ruble – singular genitive case;
    rubles – plural genitive case;
    m – masculine (w – feminine, s – neuter);
    “kopeck, kopeck, kopeck, zh” – fractional part, similar to the subject of calculus (may be absent);
    “2” – the number of digits of the fractional part (may be absent, default is 2).

Use in standard solutions

In configurations built on , in a common module WorkWithRatesCurrencies there is a function

FormAmountInWords(AmountNumber, Currency, Withdraw Amount Without Kopecks= False)

The function is used to convert currency amounts into a string in words.

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 - total number 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 the representation is in the form empty line. If "CHN=" is specified, then in the form of "0". Not used for numeric input fields.
  • CHN - whether leading zeros should be output. Meaning 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 - 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 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.
2024 wisemotors.ru. How it works. Iron. Mining. Cryptocurrency.