diff options
author | Antony Kellermann | 2018-01-18 18:02:38 -0500 |
---|---|---|
committer | Antony Kellermann | 2018-01-18 18:02:38 -0500 |
commit | aa4cb48ac236370a4aaddb9fa9413e4043f6cc17 (patch) | |
tree | e0ac20f49dca986a9ec80e8487ea4eedbe3772ca /portfolio.c | |
parent | 1e7a5c2156fc56f4d77104489135bfaa6736eb0d (diff) | |
download | aur-aa4cb48ac236370a4aaddb9fa9413e4043f6cc17.tar.gz |
Updated license and made minor changes to output
Diffstat (limited to 'portfolio.c')
-rw-r--r-- | portfolio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/portfolio.c b/portfolio.c index 3a36388895cf..a3ce051e06c2 100644 --- a/portfolio.c +++ b/portfolio.c @@ -118,7 +118,7 @@ void portfolio_print_all(FILE* fp) { memset(ticker_name_string, '\0', 32); free(data); } - printf("\nTotals: Value: $%lf. Expenditures: $%lf. Profit: %lf (%lf%%)\n", + printf("\nTotals: Value: $%8.2lf. Expenditure: $%8.2lf. Profit: %6.2lf (%4.2lf%%)\n", total_owned, total_spent, total_owned - total_spent, (100 * (total_owned - total_spent)) / total_spent); free(str); free(ticker_name_string); @@ -133,7 +133,7 @@ double* portfolio_print_stock(char* ticker_name_string, FILE* fp){ if (a[0] == 0 && a[1] == 0) printf("Your portfolio does not contain %s\n", ticker_name_string); else - printf("%lf %s. Value: $%lf. Expenditure: $%lf. Profit: %lf (%lf%%)\n", + printf("%8.4lf %5s. Value: $%8.2lf. Expenditure: $%8.2lf. Profit: %6.2lf (%4.2lf%%)\n", a[0] / ticker_price_usd, ticker_name_string, a[0], a[1], a[0] - a[1], (100 * (a[0] - a[1])) / a[1]); } else{ free(a); |