function doCalc(inputDiv, resultDiv, resultName){ var value; value = Number($(inputDiv).val()); $(resultDiv).text(resultName +": "+ value + " cm"); return value }