Converting a currency input to a numerical value in code?

Hey; I’m really new to coding. I just made a simple calculator; user inputs a number and the output is a function of that number. However, I would like to modify it so that if a user inputs a number with spaces or commas (for example, “100,000” instead of “100000”), the function will still work. Any thoughts?

  1. Get the value from input.

  2. Manipulate the vlaue before putting it into your function for calculation.

  3. Calculate your new manipulated input.

  4. Get value from input…

$w('#input1').onChange(()=>{
	let myValue = $w('#input1').value;
});
  1. Manipulation…
$w('#input1').onChange(()=>{
	let myValue = $w('#input1').value;
	let myManipulatedValue = myValue. ......... //<-- manipulation-process here!
});

a) Split-Manipulation…

.split() ---> myManipulatedValue = myValue.split(","); console.log(myManipulatedValue);

b) .slice()-manipulation-method
c) .trim()-manipulation-method
d) .substring()-manipulation-method
e) and so on…

!!! FIND THE RIGHT → STRING-MANIPULATION-METHOD !!!

And the rest of how to get your end-result is pure logic!

Good luck!