Skip to content

Instantly share code, notes, and snippets.

@danielsan
Created December 3, 2015 18:13
Show Gist options
  • Save danielsan/362c87589b38b38f6e79 to your computer and use it in GitHub Desktop.
Save danielsan/362c87589b38b38f6e79 to your computer and use it in GitHub Desktop.
functions to aid stock market decision making
function how_much_do_i_need_to_invest_to_get_x_a_month_with_z_dividend_yield(x,z){
var yearYield = z / 100,
monthYield=yearYield / 12,
total = x / monthYield;
return total;
}
// how much do i need to invest to get 1000 a month with 2.97% dividend yield
// how_much_do_i_need_to_invest_to_get_x_a_month_with_z_dividend_yield(1000, 2.97);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment