From 8eaba566fdf4732bdddfd42eac2ebb56e9dbba14 Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 4 Sep 2023 08:57:23 -0400 Subject: [PATCH] Force avg zins/zouts to be a double --- src/wallet/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 01c379ecd..7c52b744e 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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);