Browse Source

Force avg zins/zouts to be a double

pull/321/head
Duke 9 months ago
parent
commit
8eaba566fd
  1. 4
      src/wallet/rpcwallet.cpp

4
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);

Loading…
Cancel
Save