Force avg zins/zouts to be a double

This commit is contained in:
Duke
2023-09-04 08:57:23 -04:00
parent 0f4956dcd5
commit 8eaba566fd

View File

@@ -3769,8 +3769,8 @@ UniValue z_getstats(const UniValue& params, bool fHelp, const CPubKey& mypk)
}
}
UniValue ret(UniValue::VOBJ);
double avg_zins = total_ztxs > 0 ? total_zins / total_ztxs : 0.0;
double avg_zouts = total_ztxs > 0 ? total_zouts / total_ztxs : 0.0;
double avg_zins = total_ztxs > 0 ? (double) total_zins / total_ztxs : 0.0;
double avg_zouts = total_ztxs > 0 ? (double) total_zouts / total_ztxs : 0.0;
ret.pushKV("total_ztxs", total_ztxs);
ret.pushKV("avg_zins", avg_zins);
ret.pushKV("avg_zouts", avg_zouts);