How to calculate interest and discount on a line?

2

On my button I stated like this:

numero_de_parcelas = Integer.parseInt(txtNumeroParcelas.getText());
juros = Float.parseFloat(txtJuros.getText());
desconto = Float.parseFloat(txtDesconto.getText());
valor_da_venda = Float.parseFloat(txtValorVenda.getText());
valor_da_parcela = valor_da_venda / numero_de_parcelas;

But when I show the total in the table with interest and discounts does not work my calculation:

Mparcela.setPreco_parcelas((valor_da_parcela+(valor_da_parcela*
    (juros/100)))-(valor_da_parcela-((valor_da_parcela*(desconto/100)))));
          mp.setPreco_total(Float.parseFloat(txtTotal.getText()));

Interest only works when I leave it like this:

Mparcela.setPreco_parcelas(valor_da_parcela+(valor_da_parcela*(juros/100)));
mp.setPreco_total(Float.parseFloat(txtTotal.getText()));

But the discount I do not know how to do ...

Does anyone know?

    
asked by anonymous 31.10.2017 / 23:08

0 answers