diff options
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | LICENSE | 4 | ||||
-rw-r--r-- | portfolio.c | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore index 293375d70452..708e929ec4e4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,8 @@ CMakeLists.txt cmake-build-debug/ *.o -tick
\ No newline at end of file +tick +tick.1.gz +*.xz +src/ +pkg/
\ No newline at end of file @@ -4,4 +4,6 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Data provided for free by IEX. Please read IEX's license: https://iextrading.com/api-exhibit-a
\ No newline at end of file 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); |