2
On my button I declared so:
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()));
It only works the interest alone when I leave like this:
Mparcela.setPreco_parcelas(valor_da_parcela+(valor_da_parcela*(juros/100)));
mp.setPreco_total(Float.parseFloat(txtTotal.getText()));
But the discount I don’t know how to do...
Does anyone know?
Textbox? I’ve never seen this in Java. No would jtextfield?
– user28595
Yes! Excuse me, excuse me...
– Victorprvt
So: mp.setPreco_parcelas((valor_da_parcela+(valor_da_parcela*(juros/100)))-(valor_da_parcela+((valor_da_parcela*(desconto/100)));no young man, now he brought me a negative number
– Victorprvt
(valor_da_parcela+(valor_da_parcela*juros/100))-(valor_da_parcela*desconto/100)
, confirm on Ideone– Isac