Hello,
I'm new in java programming, i have insert amounts in database in this Format exp : 1.100.200,00 but the subtraction of this amount give false result .
here is part of my code
DecimalFormat df = new DecimalFormat();
DecimalFormatSymbols symbols = new DecimalFormatSymbols();
symbols.setDecimalSeparator(',');
symbols.setGroupingSeparator(' ');
df.setDecimalFormatSymbols(symbols);
statement = connection.prepareStatement("INSERT INTO Client ( Nom , Prenom, Num , Nom_projet, Bloc ,Date_de_naissance , Adresse , Type, N°_loge , prix_loge, Verse_total, Etage,Verse_restant,Verse_1,Verse_2,Verse_3,Verse_4,Verse_5,Verse_6,Verse_7,Date_1,Date_2,Date_3,Date_4,Date_5,Date_6,Date_7,Surface) VALUES(? ,? ,? ,? ,? ,? ,? ,? ,? ,? , ?,?,(?-?),?,0,0,0,0,0,0,?,0,0,0,0,0,0,?) ");
String v = comboBox_1.getSelectedItem().toString();
statement.setString(1, nom.getText());
statement.setString(2, prenom.getText());
statement.setString(3, num.getText());
statement.setString(4,comboBox.getSelectedItem().toString());
statement.setString(5,idbloc.getText());
statement.setString(6, datenaissance.getText());
statement.setString(7, adresse.getText());
statement.setString(8,comboBox_1.getSelectedItem().toString());
statement.setString(9, n.getText());
statement.setString(10, textField.getText());//je veux l'inserer en BigDecimal
statement.setString(11, versement.getText());//je veux l'inserer en BigDecimal
statement.setString(12, comboBox_2.getSelectedItem().toString());
statement.setString(13, textField.getText());//je veux l'inserer en BigDecimal
statement.setString(14, versement.getText());//je veux l'inserer en BigDecimal
statement.setString(15, versement.getText());
statement.setString(16, date.getText());
statement.setString(17, surf.getText());
statement.executeUpdate();