summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-08-11 12:26:54 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-08-11 12:26:54 +0200
commitf68447e201b2dbf0d9c25537cb1d26e2f7eea2ac (patch)
treebee24d03c73019d71f3945ed45080ea30da6e066
parente0eca2e6644e791b5523833d3792b1020b81d2ce (diff)
Use float for power
-rw-r--r--src/publisher.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/publisher.c b/src/publisher.c
index ce6df70..ce6a022 100644
--- a/src/publisher.c
+++ b/src/publisher.c
@@ -128,8 +128,8 @@ int main(int argc, char *argv[]) {
printf(
"Too many measurements to publish. Please increase ZMQ_MSG_SIZE\n");
} else {
- sprintf(queues[queue_id].msg + queues[queue_id].size, "%ld,%ld,%d\n",
- power_ts.tv_sec, power_ts.tv_nsec, atoi(buffer));
+ sprintf(queues[queue_id].msg + queues[queue_id].size, "%ld,%ld,%f\n",
+ power_ts.tv_sec, power_ts.tv_nsec, atof(buffer));
queues[queue_id].size +=
strlen(queues[queue_id].msg + queues[queue_id].size);
}