I am trying to create a reverse heading app and have gotten the subtraction part of it to work but when I punch in 30 for example instead of pumping out 210 degrees it pumps out 30180. My code is below and I would love some suggestions on how to fix this.
if(convertFromValue > 360){
paraGraph.innerHTML = 'Please enter a number between 1 and 360';
}
else
{
if(convertFromValue > 180) {
paraGraph.innerHTML = convertFromValue - 180 ;
}
else
{
paraGraph.innerHTML = convertFromValue + 180 ;
}
}
}