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; 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"