Merge #1425: gui(send): display max calculated amount w/ 8 decimals
7ab6d05f0bc0c00cfe9a160e8320f4c7de1ae212 gui(send): display max calculated amount w/ 8 decimals (pythcoiner) Pull request description: fixes #1424  ACKs for top commit: edouardparis: utACK 7ab6d05f0bc0c00cfe9a160e8320f4c7de1ae212 Tree-SHA512: 9c4dc7f2ccf2a8c2e6b62a0d628f70bc9a357b70960d215b64d3c695e32610158ee875c78d41e6c942c87cc9fe9633f77e509056d4cf85614c98ee05bf926eab
This commit is contained in:
commit
5133137d49
@ -8,7 +8,7 @@ use iced::{
|
||||
|
||||
use liana::{
|
||||
descriptors::LianaPolicy,
|
||||
miniscript::bitcoin::{bip32::Fingerprint, Amount, Network},
|
||||
miniscript::bitcoin::{bip32::Fingerprint, Amount, Denomination, Network},
|
||||
};
|
||||
|
||||
use liana_ui::{
|
||||
@ -379,14 +379,14 @@ pub fn recipient_view<'a>(
|
||||
.width(Length::Fixed(110.0)),
|
||||
)
|
||||
.push_maybe(if is_max_selected {
|
||||
let amount_txt = Amount::from_str_in(&amount.value, Denomination::Bitcoin)
|
||||
.ok()
|
||||
.map(amount_as_string)
|
||||
.unwrap_or(amount.value.clone());
|
||||
Some(
|
||||
Container::new(
|
||||
text(amount.value.clone())
|
||||
.size(P1_SIZE)
|
||||
.style(color::GREY_2),
|
||||
)
|
||||
.padding(10)
|
||||
.width(Length::Fill),
|
||||
Container::new(text(amount_txt).size(P1_SIZE).style(color::GREY_2))
|
||||
.padding(10)
|
||||
.width(Length::Fill),
|
||||
)
|
||||
} else {
|
||||
None
|
||||
|
||||
@ -39,7 +39,7 @@ pub fn unconfirmed_amount_with_size<'a, T: 'a>(a: &Amount, size: u16) -> Row<'a,
|
||||
//
|
||||
|
||||
// Format a BTC amount as a string for display.
|
||||
fn amount_as_string(a: Amount) -> String {
|
||||
pub fn amount_as_string(a: Amount) -> String {
|
||||
let amount = a.to_btc().to_string();
|
||||
|
||||
// Reformat the integer portion of the amount with space separation.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user