Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Fixed API HTTP power report so it properly truncates to 2 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
jclapis committed Sep 20, 2020
1 parent 29fcb8b commit 433ec1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libapicore/ApiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ std::string ApiConnection::getHttpMinerStatDetail()
_ret << "<td class=right>" << device["hardware"]["sensors"][1].asString() << "</td>";

stringstream powerStream; // Round the power to 2 decimal places to remove floating point garbage
powerStream << fixed << setprecision(2) << device["hardware"]["sensors"][2].asString();
powerStream << fixed << setprecision(2) << device["hardware"]["sensors"][2].asDouble();
_ret << "<td class=right>" << powerStream.str() << "</td>";

_ret << "</tr>"; // Close row
Expand Down

0 comments on commit 433ec1b

Please sign in to comment.