mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 08:23:34 -05:00
Use null for unknown hashrate in API.
This commit is contained in:
@@ -40,13 +40,15 @@
|
|||||||
#include "workers/Workers.h"
|
#include "workers/Workers.h"
|
||||||
|
|
||||||
|
|
||||||
static inline double normalize(double d)
|
static inline rapidjson::Value normalize(double d)
|
||||||
{
|
{
|
||||||
|
using namespace rapidjson;
|
||||||
|
|
||||||
if (!isnormal(d)) {
|
if (!isnormal(d)) {
|
||||||
return 0.0;
|
return Value(kNullType);
|
||||||
}
|
}
|
||||||
|
|
||||||
return floor(d * 100.0) / 100.0;
|
return Value(floor(d * 100.0) / 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user