Validate agency DV and federal savings account

Asked

Viewed 5,325 times

-5

I could not find any documentation that says which account should be made to validate the DV of the federal savings bank, someone knows which account should be made or where I find this information?

I was able to find all the other banks except the cashier.

Based on the information that @aa_sp passed, so was the account.

public String getDVContaCaixaEconomicaFederal(String agencia, String conta)
{
    int[] multiplicadores = {8,7,6,5,4,3,2,9,8,7,6,5,4,3,2};
    int soma = 0;
    String numero = agencia + conta;

    for (int i = 0; (i < (numero.Length) && i < (multiplicadores.Length)); i++)
        soma += (int.Parse(numero.Substring(i, 1)) * multiplicadores[i]);

    int dac = soma * 10;

    int m = ((dac / 11) * 11);

    int dv = dac - m;

    if (dv == 10)
        dv = 0;

    return dv.ToString();
}
  • Usually the digit checker is done in module 11 base 2. But for which you want, agency, account, our number?

  • 2

    see if this doc helps you: http://177.153. 6.25/ercompany.com.br/boleto/Laravel-boleto-master/manuals/Rules%20Validacao%20Conta%20Corrente%20VI_EPS.pdf

  • @aa_sp Thank you very much.

  • 1

    I will put as response the excerpt of the document that has the rule

  • If you want to create new tags, be sure to at least accentuate them properly. I removed the [type-checker] tag. What you want here is to know the [algorithm] used.

  • @Victorstafusa improved so?

Show 1 more comment

1 answer

3


Browser other questions tagged

You are not signed in. Login or sign up in order to post.