[hackers] [slstatus] Add unit to temperature || Aaron Marcher
commit 062f33f8742c645a3b436f609a19219106a8af75
Author: Aaron Marcher <me_AT_drkhsh.at>
AuthorDate: Sun May 20 00:02:49 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Sun May 20 00:02:49 2018 +0200
Add unit to temperature
diff --git a/components/temperature.c b/components/temperature.c
index 64199f5..32eb691 100644
--- a/components/temperature.c
+++ b/components/temperature.c
_AT_@ -10,7 +10,7 @@
int temp;
return (pscanf(file, "%d", &temp) == 1) ?
- bprintf("%d", temp / 1000) : NULL;
+ bprintf("%d°C", temp / 1000) : NULL;
}
#elif defined(__OpenBSD__)
#include <errno.h>
_AT_@ -41,6 +41,6 @@
}
/* kelvin to celsius */
- return bprintf("%d", (temp.value - 273150000) / 1000000);
+ return bprintf("%d°C", (temp.value - 273150000) / 1000000);
}
#endif
Received on Sun May 20 2018 - 00:03:10 CEST
This archive was generated by hypermail 2.3.0
: Sun May 20 2018 - 00:12:23 CEST