The sum in words (COM-component)

Russian version

.NET version

SmartTag-vercion


COM-component for translation of numbers in verbal representation ("the sum in words")

Makes converting numbers and simple expressions in verbal representation. Numbers in length up to 15 digits (999 billion) are processed, verbal representation is formed for three currencies (rouble, dollar, euro) in Russian and English languages.

INSTALLATION:

  • the component functions on computers with Windows 2000/98 (on other versions it was not tested)
  • It is necessary to establish last version Windows Scripting Host (5.5 or higher)
  • file InWordsIntl.wsc from archive place in any folder (which will not delete in the near future) and register in system (by means of a command "regsvr32 InWordsIntl.wsc" or command "Install" in the context menu of Windows explorer).

PROPERTIES and METHODS:

  • ValutaId - the Identifier of currency (it is possible to set "R" for roubles, "$" for USD, "E" for Euro).
  • Language - the Identifier of language of verbal representation (it is possible to set "ru"/1049 for Russian, "en"/1033 for English).
  • CheckExpression - Try to calculate expression in Source (boolean).
  • CutOffZero - Not to form representation of zero values of copecks/cents.
  • OddMoneyInWords - Form verbal representation of copecks/cents (boolean).
  • Source - the reference Value (number or a line) for converting in verbal representation.
  • Result - Result of converting (property by default).
  • Convert(string) - Execute converting a string to return result of converting.
  • Execute() - Execute converting value from Source, place result into Result.
  • SetDefault() - Fix the current values of parameters (ValutaId, Language, CheckExpression, CutOffZero, OddMoneyInWords) as values "by default"
  • RubInWords(num) - Number in roubles.
  • UsdInWords(num) - Number in Dollars.
  • EurInWords(num) - Number in Euro.

USAGE.

Properties and methods of a component can be used in any program, capable to represent itself as the client of OLE-automation - VB, VC, WSH, MS Office-components, Delphi etc.

Examples:

  • File conv_test.vbs - examples of use of the converter in WSH. For start use a command
    cscript.exe conv_test.vbs
  • FileIVin&Word.vbs - an example of use in FarScriptHost environment. Details - in file IVinWord.read.me.en  
  • File conv_test.xls contains functions (ToUSD, ToRUR, ToEUR) which can be used for reception of verbal representation of numbers from cells of the table in English and Russian languages. At opening a file in MS Excel it is necessary to allow running macroses.

Remarks:

  • During first use the converter establishes own parameters "by default" according to system adjustments. For change this values use method SetDefault. An example of use of a method see in a file conv_test.vbs.
  • Before use of method Convert property ValutaId can appropriate value "" (an empty string) or "?? ". The method in this case will try to allocate the name of monetary unit in the handed string.

Opportunities on updating the program:

The program is written in language VBScript, delivered as an initial code. Updating the program needs only the elementary text editor, the compiler is not necessary.
You can make any changes to a code (if something will turn out useful, inform me).

  % Loading of archive with the program: site-1 site-2.