// This function is designed to interpret strings with formatted numbers (which may contain currencies, digit grouping commas, units, etc.)
// This function is designed to interpret strings with formatted numbers (which may contain currency symbols, digit grouping commas, units of measurement, etc.)
// It will return NaN if it cannot be interpreted as a valid number (i.e. no numeric characters, multiple periods or minus signs, etc.)
// It will return NaN if it cannot be interpreted as a valid number (i.e. no numeric characters, multiple periods or minus signs, etc.)
if(typeof(val)==='number'){
if(typeof(val)==='number'){
// If the input argument is already a number, then nothing needs to be done, simply return the input value
// If the input argument is already a number, then nothing needs to be done, simply return the input value
if(Number.isNaN(val)==true){
if(Number.isNaN(val)==true){
// However, we do need to check that it isn't NaN, because that is identified as a number.
// However, we do need to check that it isn't NaN, because NaN is identified as a 'number' type.
returnNaN;
returnNaN;
}
}
else{
else{
@ -1919,10 +1988,12 @@ function parseNum(val) {
}
}
elseif(typeofval==='string'){
elseif(typeofval==='string'){
// If the input argument is a string, then the parsing process begins
// Empty string is interpreted as 0
// Empty string is interpreted as 0
if(val==''){return0;}
if(val==''){return0;}
// First, remove all non-numeric characters on the outsides of the string
// First, remove all non-numeric characters on the outsides of the string (with exceptions for minus signs or other numerically-meaningful characters)
for(vari=0;i<val.length;i++){
for(vari=0;i<val.length;i++){
// Loop through each character starting from the front
// Loop through each character starting from the front
if(!(i<val.length)){break;}
if(!(i<val.length)){break;}
@ -1935,7 +2006,7 @@ function parseNum(val) {
continue;
continue;
}
}
elseif((/[-]/g).test(val[i])==true){
elseif((/[-]/g).test(val[i])==true){
// If character is a negative sign, continue searching without deleting it. This is because there may still be non-number characters between the negative sign and the first digit, such as "-$1.00". The negative sign should stay but the dollar needs to be removed.
// If character is a minus sign, continue searching without deleting it. The search continues because there may still be non-number characters between the negative sign and the first digit, such as "-$1.00". The negative sign should stay but the dollar needs to be removed.
<divstyle="padding-left:20px; max-width:100%;">The timing parameters used for these calculations are defined by the <a>CTA-861</a> standard. The definitions for this format are listed under Video Identification Code (VIC) #98, first defined in <astyle="white-space:nowrap;">CTA-861-F</a> (formerly CEA-861-F).</div>
<divstyle="padding-left:20px; max-width:100%;">The timing parameters used for these calculations are defined by the <a>CTA-861</a> standard. The definitions for this format are listed under Video Identification Code (VIC) #98, first defined in <astyle="white-space:nowrap;">CTA-861-F</a> (formerly CEA-861-F).</div>