# Gradebook Calculations

The Elentra database does not currently store an infinite number of decimal places per gradebook assessment and use those infinite numbers in gradebook calculations. Instead Elentra rounds each percentage stored per assessment (i.e., 11/17 is stored as 64.706%). Elentra then uses those rounded percentages when it calculates weighted totals (and rounds the weighted total).

Similarly, weights are also stored as floating point values (gradebook assessment weights, form weights, collection weights for example). This can also lead to a loss in precision.

The Elentra database can also store more digits than are necessarily configured to display to learners when they view their assessment results. These multiple factors can sometimes lead to confusion if learners try to calculate their own final grade and find a discrepancy between their calculations and what's displayed in Elentra. Organizations might consider including a boilerplate statement explaining this to learners on their course websites (or in other policy documents).

#### For Developers

Assessment grade table information is stored as a float - a float gives you a lot of precision, but in the context of the databases we use, there is a limit to the number of decimal places that are stored.

Consortium schools can adjust the`GRADEBOOK_GRADE_PRECISION` constant to configure how many decimals are used, but the maximum Elentra supports is 4.

The `GRADEBOOK_GRADE_PRECISION` constant is used to determine decimal places for assessment grades and weights. For instance:

`1round($weighted_total, GRADEBOOK_GRADE_PRECISION)` in`www-root/core/modules/admin/gradebook/api-edit.inc.php:3101number_format($output, GRADEBOOK_GRADE_PRECISION)`

`www-root/core/library/Entrada/gradebook/handlers.inc.php:821Number(weight.toFixed(GRADEBOOK_GRADE_PRECISION))`

`www-root/javascript/gradebook/view.js:835`

Currently we are aware of one place where the **precision constant is not used**: `www-root/core/library/Entrada/LearnerExplorer.php:147` assumes decimal precision is 2.
