mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-07 16:05:05 -05:00
Use normalize for load average values.
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "base/tools/Handle.h"
|
||||
#include "rapidjson/document.h"
|
||||
@@ -157,13 +158,7 @@ const char *xmrig::Hashrate::format(double h, char *buf, size_t size)
|
||||
|
||||
rapidjson::Value xmrig::Hashrate::normalize(double d)
|
||||
{
|
||||
using namespace rapidjson;
|
||||
|
||||
if (!std::isnormal(d)) {
|
||||
return Value(kNullType);
|
||||
}
|
||||
|
||||
return Value(floor(d * 100.0) / 100.0);
|
||||
return Json::normalize(d, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user