Fix grades average (#49)

This commit is contained in:
Mikołaj Pich 2018-01-15 21:01:42 +01:00 committed by Rafał Borcz
parent be161cf161
commit 66fe25d9cc

View File

@ -38,11 +38,11 @@ public final class AverageCalculator {
if (valueOfGrade.matches("[-][0-6]")
|| valueOfGrade.matches("[0-6][-]")) {
String replacedValue = valueOfGrade.replaceAll("[-]", "");
return Float.valueOf(replacedValue) - 0.25f;
return Float.valueOf(replacedValue) - 0.33f;
} else if (valueOfGrade.matches("[+][0-6]")
|| valueOfGrade.matches("[0-6][+]")) {
String replacedValue = valueOfGrade.replaceAll("[+]", "");
return Float.valueOf((replacedValue)) + 0.25f;
return Float.valueOf((replacedValue)) + 0.33f;
} else if (valueOfGrade.matches("[-|=]{1,2}[0-6]")
|| valueOfGrade.matches("[0-6][-|=]{1,2}")) {
String replacedValue = valueOfGrade.replaceAll("[-|=]{1,2}", "");