From b8df32111dee21951481c7368d3e6aa3559ee013 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Fri, 29 Apr 2022 12:04:43 -0400 Subject: [PATCH] Fix /proc/memory to return floats --- src/components/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/memory.cpp b/src/components/memory.cpp index 74b396e..4bae939 100644 --- a/src/components/memory.cpp +++ b/src/components/memory.cpp @@ -23,7 +23,7 @@ bool memory::getProcMem(crow::json::wvalue& ret){ final_space = i; } - ret[line.substr(0,colon)] = line.substr(last_space, final_space - last_space); + ret[line.substr(0,colon)] = std::stof(line.substr(last_space, final_space - last_space)); } } else { ret["message"] = "Failed to open proc filesystem";