int16 function to calculate altitude in dm