Skip to content

Commit

Permalink
Change CLI to adapt market API change. bitshares#144
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Jan 23, 2018
1 parent c55ee9b commit d0297ee
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,11 @@ class wallet_api_impl
ss << setiosflags( ios::fixed ) << setprecision(6) << n;
}
};
auto prettify_num_string = [&]( string& num_string )
{
double n = fc::to_double( num_string );
prettify_num( n );
};

ss << setprecision( 8 ) << setiosflags( ios::fixed ) << setiosflags( ios::left );

Expand All @@ -2250,13 +2255,13 @@ class wallet_api_impl
{
if ( i < bids.size() )
{
bid_sum += bids[i].base;
bid_sum += fc::to_double( bids[i].base );
ss << ' ' << setw( spacing );
prettify_num( bids[i].price );
prettify_num_string( bids[i].price );
ss << ' ' << setw( spacing );
prettify_num( bids[i].quote );
prettify_num_string( bids[i].quote );
ss << ' ' << setw( spacing );
prettify_num( bids[i].base );
prettify_num_string( bids[i].base );
ss << ' ' << setw( spacing );
prettify_num( bid_sum );
ss << ' ';
Expand All @@ -2270,13 +2275,13 @@ class wallet_api_impl

if ( i < asks.size() )
{
ask_sum += asks[i].base;
ask_sum += fc::to_double( asks[i].base );
ss << ' ' << setw( spacing );
prettify_num( asks[i].price );
prettify_num_string( asks[i].price );
ss << ' ' << setw( spacing );
prettify_num( asks[i].quote );
prettify_num_string( asks[i].quote );
ss << ' ' << setw( spacing );
prettify_num( asks[i].base );
prettify_num_string( asks[i].base );
ss << ' ' << setw( spacing );
prettify_num( ask_sum );
}
Expand Down

0 comments on commit d0297ee

Please sign in to comment.