I'm using this code
Qt Code:
  1. QSqlQuery query_p_total;
  2.  
  3. query_p_total.prepare("SELECT :x * :y");
  4.  
  5. query_p_total.bindValue(":x", ui.peso_por_peca_label->text() );
  6. query_p_total.bindValue(":y", ui.n_pecas_final_lineEdit->text() );
  7.  
  8. if (!query_p_total.exec()){
  9. QMessageBox::critical(0, tr("Error"),
  10. QString("There is an error with query.exec()!"));
  11. }else{
  12. while (query_p_total.next()) {
  13. ui.peso_total_final_label->setText(query_p_total.value(0).toString());
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 

ui.peso_por_peca_label->text() ) has value 20.16 and ui.n_pecas_final_lineEdit->text() has value 6, then ui.peso_total_final_label should show me 120.96, but it is showing me 121. When I try to select 20.16 * 6 in the MYSQL console I get the right result, so I think there is something with QLineEdit, but what could it be? Or what else could it be?

Renan