File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -927,17 +927,24 @@ pub fn interactive_select(
927927 selected : & [ bool ] ,
928928 scroll_offset : usize |
929929 -> Result < ( ) , WalletError > {
930+ let selected_total = choices
931+ . iter ( )
932+ . zip ( selected)
933+ . filter ( |( _, sel) | * * sel)
934+ . map ( |( ( selected_choice, _) , _) | selected_choice. amount . to_btc ( ) )
935+ . collect :: < Vec < _ > > ( ) ;
930936 if max_scroll > 0 {
931937 queue ! (
932938 stdout,
933939 MoveTo ( 0 , 2 ) ,
934940 Print ( format!(
935- "\x1b [90mScrolling: {} / {} (showing rows {}-{})\x1b [0m" ,
936- scroll_offset + 1 ,
937- max_scroll + 1 ,
938- scroll_offset + 1 ,
939- ( scroll_offset + visible_rows) . min( total_rows)
940- ) )
941+ "\x1b [90mScrolling: {} / {} (showing rows {}-{})\x1b [0m Total Selected (In BTC) : {:.8}" ,
942+ scroll_offset + 1 ,
943+ max_scroll + 1 ,
944+ scroll_offset + 1 ,
945+ ( scroll_offset + visible_rows) . min( total_rows) ,
946+ selected_total. iter( ) . sum:: <f64 >( )
947+ ) )
941948 ) ?;
942949 }
943950 // Clear only the grid area, not the entire screen
You can’t perform that action at this time.
0 commit comments