Removing a dollar sign with click selector

Is there a way to remove a $ when using the click selector in a formula? I am trying to divide two numbers to find a percentage number but the numbers have a dollar sign in front of them.

Hey @echapman

I'm not sure if I understood your question. However, here's one snippet that might help:

Input one: ${formtext: name=first; default=20}

Input two: ${formtext: name=second; default=40}

Percentage: {=round(first/second*100, 2)}%

Note how I have moved the $ sign outside the text field itself in this snippet.

If you do not control the inputs - for example: they're coming from a site command, then you can use substring to do the calculation:

Input one: {first="$20"}{=first}

Input two: {second="$50"}{=second}

Percentage: {=round(substring(first, 2) / substring(second, 2) * 100, 2)}%

substring(first, 2) will take all characters in the string first starting from the second character.

Let me know if it works for you.

I don't think this is exactly what I am looking for for. I am using the click selector to copy data from a website and the data includes a $ at the beginning but to find the percentage that $ can't be there. So i'm wondering if there is a way to remove it in the formula so it works

Can you share the snippet you have so far? I can help suggest changes based on that.

I was able to figure out it out using the replace regex

1 Like