Как вычесть и добавить число с разделителями типа (1.500, 00)
Привет,
вот часть моего кода
statement=connection.prepareStatement("SELECT prix_loge FROM Liste WHERE Nom=? AND Prenom=?"); statement.setString(1, comboBox_1.getSelectedItem().toString()); statement.setString(2, comboBox_2.getSelectedItem().toString()); ResultSet rs=statement.executeQuery(); prix.setText(rs.getString("prix_loge")); prix.getText(); statement.close(); statement=connection.prepareStatement("SELECT Verse_total FROM Versement WHERE Nom=? AND Prenom=?"); statement.setString(1, comboBox_1.getSelectedItem().toString()); statement.setString(2, comboBox_2.getSelectedItem().toString()); ResultSet rs1=statement.executeQuery(); somme.setText(rs1.getString("Verse_total")); somme.getText(); statement.close(); statement = connection.prepareStatement("INSERT INTO Versement ( Nom , Prenom, Date , Somme_versee,Prix_loge, Nom_projet, Verse_total, Verse_restant,id_verse) VALUES(?,?,?,'"+verse.getText()+"','" + prix.getText() +"', (SELECT Nom_projet From Client WHERE Nom= ? AND Prenom= ?), ('"+ somme.getText()+"'+'"+verse.getText()+"') , ('"+prix.getText()+"' - '"+ somme.getText()+"'- '"+verse.getText()+"'),?) "); statement.setString(1, comboBox_1.getSelectedItem().toString()); statement.setString(2, comboBox_2.getSelectedItem().toString()); statement.setString(3, date.getText()); statement.setString(4, comboBox_1.getSelectedItem().toString()); statement.setString(5, comboBox_2.getSelectedItem().toString()); statement.setString(6, comboBox_4.getSelectedItem().toString()); statement.executeUpdate(); statement.close(); statement.close(); statement.close(); statement.close(); statement= connection.prepareStatement("UPDATE Liste SET Verse_total='"+somme.getText()+"'+'"+verse.getText()+"' , Verse_restant='"+ prix.getText()+"'-'"+somme.getText()+"', Verse_2=( SELECT(Somme_versee) FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=2),Verse_3= (SELECT(Somme_versee) FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=3),Verse_4= (SELECT(Somme_versee) FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=4),Verse_5= (SELECT(Somme_versee) FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=5),Verse_6= (SELECT(Somme_versee) FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=6),Verse_7= (SELECT(Somme_versee) FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=7), Date_2=(SELECT Date FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=2),Date_3=(SELECT Date FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=3), Date_4=(SELECT Date FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=4),Date_5=(SELECT Date FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=5),Date_6=(SELECT Date FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=6), Date_7=(SELECT Date FROM Versement WHERE Nom=? AND Prenom=? AND id_verse=7) WHERE Nom=? AND Prenom= ? " ); statement.setString(1, comboBox_1.getSelectedItem().toString()); statement.setString(2, comboBox_2.getSelectedItem().toString()); statement.setString(3, comboBox_1.getSelectedItem().toString()); statement.setString(4, comboBox_2.getSelectedItem().toString()); statement.setString(5, comboBox_1.getSelectedItem().toString()); statement.setString(6, comboBox_2.getSelectedItem().toString()); statement.setString(7, comboBox_1.getSelectedItem().toString()); statement.setString(8, comboBox_2.getSelectedItem().toString()); statement.setString(9, comboBox_1.getSelectedItem().toString()); statement.setString(10, comboBox_2.getSelectedItem().toString()); statement.setString(11, comboBox_1.getSelectedItem().toString()); statement.setString(12, comboBox_2.getSelectedItem().toString()); statement.setString(13, comboBox_1.getSelectedItem().toString()); statement.setString(14, comboBox_2.getSelectedItem().toString()); statement.executeUpdate();
вычитание и сложение действительного числа (например, 10.200,00) дают ложный результат
Что я уже пробовал:
я краснею уже 2 недели