json库中似乎没有解决方案,因此我必须自己修改数字并用引号将其包装。我将此功能应用到了响应中。
[](std::string& jsonStr) { // matches "amount" field in json static std::regex reg(R"((s*"amount"s*:)s*(d*.{0,1}d{0,8})s*)"); jsonStr = std::regex_replace(jsonStr, reg, "$1"$2""); };现在它可以正常工作了。



