From 6d4599bcee9a9f742a66c8945ba92d6a3ca2351e Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 29 Oct 2019 14:46:46 -0700 Subject: [PATCH 1/2] Update lib to allow escaped chars in memo --- lib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cargo.toml b/lib/Cargo.toml index fc18947..f5ae56d 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -11,4 +11,4 @@ crate-type = ["staticlib"] [dependencies] libc = "0.2.58" lazy_static = "1.4.0" -zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "b928d5f09646cc94023ea25f99951fcf1b43e90d" } +zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "fe82c0b43043867b6cc1ebc462cc7b42f91b1adf" } From a4bae2051f22b31bdcd97de61f364f70f1d37ae7 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 29 Oct 2019 15:03:52 -0700 Subject: [PATCH 2/2] Remove trailing "0". Fixes #6 --- src/camount.cpp | 7 +++++-- src/mainwindow.ui | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/camount.cpp b/src/camount.cpp index c8cd723..1d50302 100644 --- a/src/camount.cpp +++ b/src/camount.cpp @@ -22,9 +22,12 @@ QString CAmount::toDecimalString() const { QString r = QString::number(wholePart); if (decimalPart > 0) { QString decimalPartStr = QString::number(decimalPart); - QString leadingZeros = QString("0").repeated(NUMPLACES - decimalPartStr.length()); + r = r + "." + decimalPartStr.rightJustified(NUMPLACES, '0'); - r = r + "." + leadingZeros + decimalPartStr; + // Trim tailing 0s + while (r.right(1) == "0") { + r = r.left(r.length() - 1); + } } return r; diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 5a9ac48..9e4a19d 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -22,7 +22,7 @@ - 3 + 1 @@ -296,7 +296,7 @@ false - From + false