function convertLinear(val, from, to) {
        let v = -Infinity;
      
        
      
        //Get the object $set by searching the Units dataset for the FROM and TO short-hand units.
        let $set = getTypeofUnits(from, to);

        //If the set contains errors, display the errors in the log
        if ($set.errors.length > 0) {
            logError($set.errors);
            return -Infinity;
        }

        //At this point, we do not have errors and we have retrieved the FROM and TO dataset objects.
        //Calculate the converted value.
	if ($set.to.xval != null && $set.from.xval != null && !isNaN($set.to.xval) && !isNaN($set.from.xval)) {
	    v = parseFloat(val * $set.to.xval / $set.from.xval);
	}
        

        //return the value
        return v;
    }
//Converts units in the jsCAU array of objects

Converts units in the jsCAU array of objects
Converts units in the jsCAU array of objects
function convertLinear(val, from, to) {
        let v = -Infinity;
        let $set = getTypeofUnits(from, to);
        if ($set.errors.length > 0) {
            logError($set.errors);
            return -Infinity;
        }
	if ($set.to.xval != null && $set.from.xval != null && !isNaN($set.to.xval) && !isNaN($set.from.xval)) {
	    v = parseFloat(val * $set.to.xval / $set.from.xval);
	}
        return v;
    }
function convertLinear ( val , from , to ) { let v = - Infinity ; let $set = getTypeofUnits ( from , to ) ; if ( $set . errors . length > 0 ) { logError ( $set . errors ) ; return - Infinity ; } if ( $set . to . xval != null && $set . from . xval != null && ! isNaN ( $set . to . xval ) && ! isNaN ( $set . from . xval ) ) { v = parseFloat ( val * $set . to . xval / $set . from . xval ) ; } return v ; }
Converts units in the jsCAU array of objects
Converts units in the jsCAU array of objects
//Get the object $set by searching the Units dataset for the FROM and TO short-hand units.
 //If the set contains errors, display the errors in the log
 //At this point, we do not have errors and we have retrieved the FROM and TO dataset objects.
 //Calculate the converted value.
 //return the value
