From 82ed1e63b1dde4b1525fe998aa56b74feb3ce949 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Wed, 18 Jan 2017 20:30:15 +0800 Subject: [PATCH] fix: show zero in matched outputs when its acctually zero. --- src/page.h | 3 ++- src/templates/my_outputs.html | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/page.h b/src/page.h index 7b6e054..aa2f399 100644 --- a/src/page.h +++ b/src/page.h @@ -1550,7 +1550,8 @@ public: context.emplace("outputs", outputs); - context["sum_xmr"] = xmreg::xmr_amount_to_str(sum_xmr); + context["found_our_outputs"] = (sum_xmr > 0); + context["sum_xmr"] = xmreg::xmr_amount_to_str(sum_xmr); context.emplace("inputs", inputs); context["show_inputs"] = false; diff --git a/src/templates/my_outputs.html b/src/templates/my_outputs.html index 185599c..7dd8f4e 100644 --- a/src/templates/my_outputs.html +++ b/src/templates/my_outputs.html @@ -62,7 +62,15 @@ {{/outputs}} -

Sum XMR from matched outputs: {{sum_xmr}}

+

+ Sum XMR from matched outputs: + {{#found_our_outputs}} + {{sum_xmr}} + {{/found_our_outputs}} + {{^found_our_outputs}} + 0.000000000000 + {{/found_our_outputs}} +