Question
removing unwanted characters from supplied data
I have a calculation to perform with 2 pieces of client supplied data. Sometimes this data is provided as <0.1 rather than specifying 0.085 for instance.
I have tried using variable.replace(/>/g,"") to remove the '>' character to be able to use just 0.1 as the data for calculation, but to no avail.
Can someone help?
eg.
var custData1 = "<0.1";
var custData2 = "50";
var sData = custData1.replace(/>/g,"");
var cCalc = (sData/custData2)*100;
