Hello, I am trying to pull up a website and automatically subtract one selector from another. The code below mostly works but when the selector is used, any characters that aren't numbers cause an error. I figured out a way to handle the "$" character but ","'s are also causing issues, and using Split probably isn't the best way to handle that.
For example, if the selectors return the values 3,058.76 - 3,048.59, it gives the error Difference between Original and Updated Cannot convert "3,058.76" to a number. If manually remove the "," from the form it works, but it's less than ideal.
Any ideas on how I should update the code to handle this?
Form and Code
Below you will find the Original Invoice and Updated Invoice totals and the difference between them.
Original Price: ${formtext: name=Orig;default={={=split({site: text; selector=.col-md-6:nth-child(1) tfoot .text-right}, "$")[2]}}}
Updated Price: ${formtext: name=Updated;default={={=split({site: text; selector=.col-md-6:nth-child(2) tfoot .text-right}, "$")[2]}}}
Difference between Original and Updated {=Orig - Updated; format=$.2f}
Webpage example