comparison web/log.py @ 436:8841a709ae78

strip multiple-of-ten temperatures correctly
author Matt Johnston <matt@ucc.asn.au>
date Mon, 22 Oct 2012 21:08:31 +0800
parents ae12b30352f0
children 3b4277aaed3c
comparison
equal deleted inserted replaced
435:c95737913174 436:8841a709ae78
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))