StringToNumber TM1 Process: Use and Syntax
StringToNumber converts a string to a number in a TM1 Turbo Integrator Process. It is very similar to the “Value” function in Excel, where you can convert a text string to a number.
If you are looking for the command to convert a number to a string in a TI, please see the NumberToString function
The syntax is:
where the String is currently stored as text that looks like a number, but is stored as text.
Usage of StringToNumber
An example is:
vNumber = StringToNumber ('50');
This will convert the string ’50’ into a number 50 and store it in variable vNumber. From here you can apply mathematical functions to it.
Alternatively, if you need to, you can convert a number back to a string by using NumberToString. So, after applying a mathematical function to it, it would look like this:
sNewString = NumberToString ( StringToNumber ( '50') x 2);
This would store a string of ‘100’ in the sNewString variable. Pretty simple, huh!
Notes and Alternatives
StringToNumber can be used in TM1 Turbo Integrator Processes only.
To convert Numbers to Strings in Rules, please see the STR function.
You can convert Numbers to Strings in TI processes, please see NumberToString.
Finally, to convert Strings to Numbers in Rules, please use the NUMBR function.