[SOLVED] float in java and in mysql
I noticed some differences in the float type while using netbeans and mysql.
while netbeans uses 7.5 mysql uses 7,5..
I don't know why they are different and how.
The following is what I am trying to achieve.
7,6 counts 3 times
7,5 counts 3 times
7,3 counts 3 times
7,9 counts 1 times
8,6 counts 1 times
6,5 counts 1 times
I want to set the average to 1 decimal like this
then I get a error:
// Creates a DecimalFormat for setting the float to 1 decimal
DecimalFormat FloatFormat = new DecimalFormat("0.0");
// Calculates the average
Average = Float.valueOf(FloatFormat.format(gradescounted/totalgrades));
java.lang.NumberFormatException: For input string: "7,5"
I don't know if that is related with the fact that netbeans and mysql uses different seperator or how to solve this problem.
Any solution is welcome, thanks in advance.