show "?" instead of 0.000 amounts.

master
moneroexamples 8 years ago
parent 5ee3ce6735
commit f17ec69d2b

@ -165,10 +165,10 @@ struct tx_details
{"pub_key" , tx_pk_str},
{"tx_fee" , fee_str},
{"tx_fee_short" , fee_short_str},
{"sum_inputs" , fmt::format("{:0.6f}", XMR_AMOUNT(xmr_inputs))},
{"sum_outputs" , fmt::format("{:0.6f}", XMR_AMOUNT(xmr_outputs))},
{"sum_inputs_short" , fmt::format("{:0.3f}", XMR_AMOUNT(xmr_inputs))},
{"sum_outputs_short" , fmt::format("{:0.3f}", XMR_AMOUNT(xmr_outputs))},
{"sum_inputs" , xmr_amount_to_str(xmr_inputs , "{:0.6f}")},
{"sum_outputs" , xmr_amount_to_str(xmr_outputs, "{:0.6f}")},
{"sum_inputs_short" , xmr_amount_to_str(xmr_inputs , "{:0.3f}")},
{"sum_outputs_short" , xmr_amount_to_str(xmr_outputs, "{:0.3f}")},
{"no_inputs" , static_cast<uint64_t>(input_key_imgs.size())},
{"no_outputs" , static_cast<uint64_t>(output_pub_keys.size())},
{"mixin" , mixin_str},

@ -253,7 +253,14 @@ static
string
xmr_amount_to_str(const uint64_t& xmr_amount, string _format="{:0.12f}")
{
return fmt::format(_format, XMR_AMOUNT(xmr_amount));
string amount_str = "?";
if (xmr_amount > 0)
{
amount_str = fmt::format(_format, XMR_AMOUNT(xmr_amount));
}
return amount_str;
}
bool

Loading…
Cancel
Save