valor_total_venda = 100
diferenca = valor_total_venda
Numero_parcelas = 3
Valor_parcela = valor_total_venda / Numero_parcelas
IF Numero_parcelas > 1
FOR i = 1 TO Numero_parcelas
comando = "diferenca = diferenca - valor_parcela"
&comando
NEXT
Endif
messagebox(alltrim(str(diferenca)))
Se vc rodar este código, verá que a diferença será zero.
Favor, preciso que este resultado final seja 0,01, pois 100/3 = 33.33 e 33.33*3 deve ser 99.99.
Acho que está tendo algum problema de arredondamento.
Agradeço
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only