From 1ed479d1d70e7bd97ed66efc7986881b48731901 Mon Sep 17 00:00:00 2001 From: Igor Cota Date: Sun, 11 Sep 2022 11:05:03 +0200 Subject: [PATCH 1/2] ENV-230: render trailing zeroes for BTC amounts --- lib/ui/amount.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ui/amount.dart b/lib/ui/amount.dart index c8063c38e..2490b3a44 100644 --- a/lib/ui/amount.dart +++ b/lib/ui/amount.dart @@ -278,11 +278,11 @@ class NumpadButton extends StatelessWidget { } } -String convertSatsToBtcString(int amountSats) { +String convertSatsToBtcString(int amountSats, {bool trailingZeroes: false}) { final amountBtc = amountSats / 100000000; NumberFormat formatter = NumberFormat(); - formatter.minimumFractionDigits = 0; + formatter.minimumFractionDigits = trailingZeroes ? 8 : 0; formatter.maximumFractionDigits = 8; return formatter.format(amountBtc); @@ -307,7 +307,8 @@ String getFormattedAmount(int amountSats, {bool includeUnit: false}) { NumberFormat satsFormatter = NumberFormat("###,###,###,###,###,###,###"); String text = Settings().displayUnit == DisplayUnit.btc - ? convertSatsToBtcString(amountSats) + (includeUnit ? " BTC" : "") + ? convertSatsToBtcString(amountSats, trailingZeroes: true) + + (includeUnit ? " BTC" : "") : satsFormatter.format(amountSats) + (includeUnit ? " SATS" : ""); return text; From 90f9831fdf33ee5f358f4e7441e16c289d174860 Mon Sep 17 00:00:00 2001 From: Igor Cota Date: Sun, 11 Sep 2022 11:05:27 +0200 Subject: [PATCH 2/2] Bump version to 1.0.6+19 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 12ba5ca00..7cfb511d4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.6+18 +version: 1.0.6+19 environment: sdk: ">=2.12.0 <3.0.0"