Support of plural forms for cardinal and ordinal numerals

If you wish to leave comments or ask questions, please log on or sign up.
This feature is implemented in 1C:Enterprise version

We have added support for strings that require harmonization with numerals to the platform. Now you can generate strings of the “run time 1 second” and “run time 32 seconds” type automatically, without analyzing the numeral in order to use the correct unit of measurement form.

To this end, we added a new StringWithNumber() method to the platform. Its working principle is based on the fact that any numeral in any language can be classified into one of the six categories:

  • ZERO
  • ONE
  • TWO
  • FEW
  • MANY

In different languages, the same numerals may refer to different categories. Besides, not all languages have all six categories. For example, in the German language, categories ZERO, TWO, FEW, and MANY are not used. The detailed table of conformity of categories with numerals for all languages can be viewed on

The StringWithNumber() method works as follows. You need to pass there string fragments for those categories that are present in the selected language. You must also pass the numeral itself. As a result, the method, depending on the numeral and language, selects one of the string fragments by placing the numeral in there, and then returns it to you.

For example, in the English language, you need to automatically display the following: “So many days left until New Year's Day”. Then, using this method might look like this:
For Counter = 1 To 7 Do
    String = StringWithNumber("; %1 day; ; ; ; %1 days",
               8 - Counter,
    Message = New UserMessage;
    Message.Text = String + " left until New Year's Day";

As a result, you get the following sequence of strings:


Or another example. In English, you must display the following: “January this date, the day of the year”. Then the code will look like this:
For Counter = 1 To 7 Do

    String = StringWithNumber( "; %1st; %1nd; %1rd; ; %1th",
    Message = New UserMessage;
    Message.Text = "January " + Counter + ", the " + String + " day of the year";

As a result, you get the following sequence of strings:


Note that these examples illustrate different types of numerals. The first example uses cardinal numerals, while the second - ordinal ones. Cardinal numbers answer the question "How many?" Ordinal numbers answer the question "Which one?"

Spelling of cardinal and ordinal numerals varies, therefore, you need to use different calls of the StringWithNumber() method. For example, in the Russian language, a noun that refers to cardinal numerals is declined according to cases and numbers (1 день, 2 дня, 5 дней), and ordinal numerals are used in the singular form (1-й день, 2-й день, 3-й день, 4-й день). In English, a noun that refers to cardinal numerals is declined only according to numbers (1 day, 2 days), and there are four different forms for ordinal numerals: 1st day, 2nd day, 3rd day, 4th day.

To help you use the new method, we specified in the Syntax Assistant the strings that you must use for each language and for each numeral type (cardinal or ordinal).


Thus, all you have to do is substitute correct measurement unit forms and use the characters "%1" to indicate, in which place of each fragment the numeral will be located.

We have already used the new string generation features in the platform interface. For example, the schedule of a scheduled job now includes the correct numeral form:


String representation of the planner schedule now contains no spelling errors.


In conclusion, we would like to point out that the new StringWithNumber() method was implemented for 21 languages:

  • Azerbaijani
  • Belarusian
  • Bulgarian
  • Chinese
  • English
  • Estonian
  • Finnish
  • French
  • Georgian
  • German
  • Hungarian
  • Kazakh
  • Latvian
  • Lithuanian
  • Polish
  • Romanian
  • Russian
  • Turkish
  • Turkmen
  • Ukrainian
  • Vietnamese