Skip to content

Instantly share code, notes, and snippets.

@oraculum
Created April 10, 2012 02:12
Show Gist options
  • Save oraculum/2347921 to your computer and use it in GitHub Desktop.
Save oraculum/2347921 to your computer and use it in GitHub Desktop.
formula pgto
private static float calcPrice(float valor, Int16 prestacoes, float juros)
{
float E, cont;
juros = juros / 100;
E = float.Parse("1");
cont = float.Parse("1");
for (int k = 1; k <= prestacoes; k++)
{
cont = cont * (1 + juros);
E = E + cont;
}
E = E - cont;
valor = valor * cont;
return valor /E;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment