Skip to content

Commit 7722c9e

Browse files
author
Suhas Hariharan
authored
Merge pull request #129 from DGET-Program/patch-1
Fix visual bug
2 parents d53b627 + 581c9cf commit 7722c9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/js/components/HypoAssignment.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
</template>
5252
<script>
5353
import { avaliableGrades, fpToGrade, gradeToFP } from '../helpers';
54+
const getInRange = require('get-in-range');
5455
5556
export default {
5657
name: 'HypoAssignment',
@@ -69,7 +70,8 @@ export default {
6970
}),
7071
computed: {
7172
hypo () {
72-
const new_fp = this.assignment.weight * 0.01 * gradeToFP(this.assignment.grade) + ((100 - (this.assignment.weight)) * 0.01 * this.currentFP);
73+
const weight = getInRange(this.assignment.weight, 0, 100, true);
74+
const new_fp = weight * 0.01 * gradeToFP(this.assignment.grade) + ((100 - weight) * 0.01 * this.currentFP);
7375
return {
7476
fp: new_fp.toFixed(2),
7577
grade: fpToGrade(new_fp),

0 commit comments

Comments
 (0)