After having rounded the individual grades, a weighted mean is used to calculate the overall result.
The weight of a grade is normally proportional to the number of hours the according subject was taught per week.
Sometimes further conditions need to be fulfilled, such as a maximum allowed number of grades below four.
This of course varies depending on the kind of exam, the tested class, the school level, the region, the teacher and other factors.
Since education is in the responsibility of the cantons (except for the federal universities), grading notations may differ depending on the region.