comparison web/log.py @ 137:d36fe81077cc

strip multiple-of-ten temperatures correctly
author Matt Johnston <matt@ucc.asn.au>
date Mon, 22 Oct 2012 21:08:31 +0800
parents 719d5669ab27
children 3b4277aaed3c
comparison
equal deleted inserted replaced
136:2b112f9ab440 137:d36fe81077cc
88 88
89 format_last_value = None 89 format_last_value = None
90 if unit: 90 if unit:
91 try: 91 try:
92 last_value = float(rrdtool.info(rrdfile)['ds[temp].last_ds']) 92 last_value = float(rrdtool.info(rrdfile)['ds[temp].last_ds'])
93 format_last_value = ('%f' % last_value).rstrip('0.') + unit 93 format_last_value = ('%f' % last_value).rstrip('0').rstrip('.') + unit
94 except ValueError: 94 except ValueError:
95 pass 95 pass
96 width = config.LINE_WIDTH 96 width = config.LINE_WIDTH
97 legend = config.SENSOR_NAMES.get(sensor, sensor) 97 legend = config.SENSOR_NAMES.get(sensor, sensor)
98 colour = config.SENSOR_COLOURS.get(legend, colour_from_string(sensor)) 98 colour = config.SENSOR_COLOURS.get(legend, colour_from_string(sensor))