FAQ - How to convert string to number in StudioX

So I couldn’t find an answer on the forum, but was able to solve this.

When using the Number feature in StudioX, I kept getting an error saying I couldn’t multiply a string by a string. Both “strings” were number values, but formatted as strings I guess (one from the input dialog activity and another from a Get Text activity).

Originally my formula in the Number feature was [Input Dialog Value] * [Get Text Value] and it kept throwing the error.

So what I did was put a number in front of the formula: 1 * [Input Dialog Value] * [Get Text Value]

Voila, it calculated the amount without an error :slight_smile:

In the simplest fashion

Use the project notebook. The default template has formulas that help you do that.

If you paste a text value in a cell a formula in another cell can return a number that you can read back.

The other way is to use the SaveForLater and in advance mode use Convert.ToInt32(string) and assign it to a numeric variable