Round instead of floor height conversion

This commit is contained in:
Ed Sandor 2020-12-30 11:03:59 -07:00
parent daa499ab93
commit 32fe01f128

View File

@ -64,10 +64,10 @@ IGLOGIN {callsign} {password}
if "aprs_igate_height": if "aprs_igate_height":
try: try:
height_m = float(pm["aprs_igate_height"]) height_m = float(pm["aprs_igate_height"])
height_ft = int(height_m * FEET_PER_METER) height_ft = round(height_m * FEET_PER_METER)
height = "HEIGHT=" + str(height_ft) height = "HEIGHT=" + str(height_ft)
except: except:
logger.error("Cannot parse 'aprs_igate_height': " + str(pm["aprs_igate_height"])) logger.error("Cannot parse 'aprs_igate_height', expected float: " + str(pm["aprs_igate_height"]))
if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))):
comment = "\"" + comment + "\"" comment = "\"" + comment + "\""