Skip to content

Commit

Permalink
Merge pull request #72 from MostroP2P/show-range-fiat-amount
Browse files Browse the repository at this point in the history
Shows fiat amount range in listorders
  • Loading branch information
grunch committed May 17, 2024
2 parents c80e9f1 + 7df6117 commit 27a4ba4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/pretty_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,18 @@ pub fn print_orders_table(orders_table: Vec<SmallOrder>) -> Result<String> {
Cell::new(single_order.amount.to_string()).set_alignment(CellAlignment::Center)
},
Cell::new(single_order.fiat_code.to_string()).set_alignment(CellAlignment::Center),
Cell::new(single_order.fiat_amount.to_string())
.set_alignment(CellAlignment::Center),
// No range order print row
if single_order.min_amount.is_none() && single_order.max_amount.is_none() {
Cell::new(single_order.fiat_amount.to_string())
.set_alignment(CellAlignment::Center)
} else {
let range_str = format!(
"{}-{}",
single_order.min_amount.unwrap(),
single_order.max_amount.unwrap()
);
Cell::new(range_str).set_alignment(CellAlignment::Center)
},
Cell::new(single_order.payment_method.to_string())
.set_alignment(CellAlignment::Center),
Cell::new(date.unwrap()),
Expand Down

0 comments on commit 27a4ba4

Please sign in to comment.