feat: support decimal on weight

This commit is contained in:
2026-02-13 21:42:48 +01:00
parent 2fd09af0ea
commit d857fce71f
9 changed files with 19 additions and 19 deletions

View File

@@ -86,7 +86,7 @@ public class RTeam {
.max(Integer::compareTo)
.map(i -> Categorie.values()[i]).orElse(Categorie.SENIOR1));
List<Integer> s = Stream.concat(
List<Float> s = Stream.concat(
pair.getKey().stream().map(RegisterModel::getWeight),
pair.getValue().stream().map(CompetitionGuestModel::getWeight))
.filter(Objects::nonNull).toList();
@@ -95,7 +95,7 @@ public class RTeam {
} else if (s.size() == 1) {
team.setWeight(s.get(0));
} else {
team.setWeight((int) s.stream().mapToInt(Integer::intValue)
team.setWeight((float) s.stream().mapToDouble(Float::doubleValue)
.average()
.orElse(0));
}