diff --git a/db/src/rest/rest.go b/db/src/rest/rest.go index ff69d59..49ecfb5 100644 --- a/db/src/rest/rest.go +++ b/db/src/rest/rest.go @@ -344,9 +344,9 @@ func (g *RestGateway) getRoomCurrent(c *gin.Context) { query := fmt.Sprintf(` SELECT date_bin(INTERVAL '5 minutes', time) AS time, - AVG(co2_ppm) AS co2_ppm, - AVG(temp) AS temp, - AVG(humidity) AS humidity, + ROUND(AVG(co2_ppm)) AS co2_ppm, + ROUND(AVG(temp), 2) AS temp, + ROUND(AVG(humidity), 2) AS humidity, MAX(window_open) AS window_open FROM "%s" WHERE time > now() - INTERVAL '1 day' @@ -403,9 +403,9 @@ func (g *RestGateway) getRoomHistory(c *gin.Context) { query := fmt.Sprintf(` SELECT date_bin(INTERVAL '5 minutes', time) AS time, - AVG(co2_ppm) AS co2_ppm, - AVG(temp) AS temp, - AVG(humidity) AS humidity, + ROUND(AVG(co2_ppm)) AS co2_ppm, + ROUND(AVG(temp), 2) AS temp, + ROUND(AVG(humidity), 2) AS humidity, MAX(window_open) AS window_open FROM "%s" WHERE time > now() - INTERVAL '%s'