Skip to content

Commit

Permalink
Use null for unknown hashrate in API.
Browse files Browse the repository at this point in the history
  • Loading branch information
xmrig committed May 8, 2019
1 parent 614b588 commit eedc782
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/api/ApiRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@
#include "workers/Workers.h"


static inline double normalize(double d)
static inline rapidjson::Value normalize(double d)
{
using namespace rapidjson;

if (!isnormal(d)) {
return 0.0;
return Value(kNullType);
}

return floor(d * 100.0) / 100.0;
return Value(floor(d * 100.0) / 100.0);
}


Expand Down

0 comments on commit eedc782

Please sign in to comment.