Number in words, detailed description. Number in words, detailed description Number in words 1s 8.3 in printed form

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.
  • 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 fraction 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. 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 boolean value Lie.
  • BI - a string representing a logical value True.

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 title decimal parts subject of calculus (Boolean), 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, rubles, m, kopeck, kopecks, kopecks, 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, rubles, m, kopeck, kopecks, kopecks, 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 calculus 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


Top