Use null for unknown hashrate in API.

This commit is contained in:
XMRig
2019-04-25 02:22:53 +07:00
parent 3c6496f2df
commit 7fc8cfca50

View File

@@ -40,13 +40,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);
}