Expression to convert string of different numbers

Any tips on running an expression that may have a field that contains “1”, “12”, “54.99”, etc. and convert that to add numbers or remove decimal if there is a decimal?

So,
if field is “1” it becomes “100”
and if “12” it becomes “1200”
and if “54.99” becomes “5499”
and if “1399.99” becomes 139999
all in the same expression?

Hey @jtas21,

At a guess you are working with currencies and the system you are playing with needs the value to be made up of the lowest currency form.

All you would need to do is x the value by 100, in the expression something like {{variable * 100}}

I will get an example put together in an hour or so for you if you have not worked it out by then.

Quick example below, It has one set node to set 4 values using a mix of decimal and whole numbers. The second set node shows how to use the expressions to make the change you want.

Just for fun I used a mixed of strings and numbers just to show that it doesn’t really matter what type of data you have.

Example Workflow

Hopefully this helps :+1:

1 Like

Awesome thanks, @Jon!

1 Like