diff --git a/src/api/v1/ApiRouter.cpp b/src/api/v1/ApiRouter.cpp index 1f3641c37..91395939c 100644 --- a/src/api/v1/ApiRouter.cpp +++ b/src/api/v1/ApiRouter.cpp @@ -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); }