UTL pre-defined object provides the utility functions described below.
string_to_number method converts a number expressed in letters into a number possibly multiplied by a factor.
For example, after the following instruction:
var strToNumber = UTL.string_to_number("EN", "onehundredseventyfive", "*M");
strToNumber is set to 175000000, that is 175 multiplied by 1000000.
The syntax is:
UTL.string_to_number(lang, string, factor)
langis the language code. It can be:
- EN for English
- IT for Italian
- DE for German
- ES for Spanish
stringis the number expressed in letters to convert.
factoris a multiplication factor, and it can assume one of the following values:
Value Multiplication factor Empty string 1 *K (kilo) 1x103 *M (mega) 1x106 *G (giga) 1x109 *T (tera) 1x1012 *m (milli) 1x10-3 *u (micro) 1x10-6 *n (nano) 1x10-9 *p (pico) 1x10-12
The returned value is a string.
If the string to be converted is not a number—for example book—the method returns -1.
Some intrinsic features of the text intelligence engine and scripting functions, used in the preparation phase, can alter the original input text.
rebase_position heuristically determines the position in which a character of the text was in the original text, if, due to manipulation, it has changed its place.
Heeeeeey duuuuude! I looooove that book.
Hey dude! I looooove that book.
the that word has moved. The character that was in position 31 (the initial t) in the original text is now in position 22.
The result of this instruction:
performed after the manipulation, will therefore be 31.
The syntax of the method is:
index is the position of a character in the current input text.