Created
February 28, 2023 17:41
-
-
Save bernardoduarte/a7a951cd45443907731130363d1751e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jurosCompostosAporteMensal(valorInicial: number, aporteMensal: number, jurosMensais: number, periodoMeses: number): number { | |
const porcentagemJurosMensais = jurosMensais / 100; | |
const taxaJurosMensais = 1 + porcentagemJurosMensais; | |
const totalTaxaJurosPeriodo = taxaJurosMensais ^ periodoMeses; | |
const ganhoValorInicial = valorInicial * totalTaxaJurosPeriodo; | |
const ganhoAportesMensais = aporteMensal * (totalTaxaJurosPeriodo - 1) / porcentagemJurosMensais; | |
return ganhoValorInicial + ganhoAportesMensais; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment