(PARTIALLY SOLVED) How to isolate numeric part of variable


#1

How do I isolate the numeric value of a changing variable?

Right now, I am pulling a stock price off of a website (price is constantly changing), and I want to use the value I get as a variable to compare against other stock prices (such as ${AAA} <= ${BBB}) later, but right now, it can’t do that because the variable looks like “$1,234 USD” when I pull it off the website. I just want the “1,234” value.

SEE BELOW POST

Is that possible?

Thanks, Nathan


#2

Looks like I can do this using the string slicer to isolate only the numbers I want. How would I isolate multiple numbers, like index numbers 2, 4, 5 and 6, and store that as my new variable?


#3

storeEval | storedVars[‘aaa’].replace(/\D/g,’’) | aaa

Google javascript, not kantu.