Skip to content

Commit c56529d

Browse files
committed
Fix an issue in HypoAssignment
Hypothetical Assignment will show a NaN if there is no value in the percentage input. This is a fix for that issue. If there is no value in the percentage field, it will be treated as a zero. Signed-off-by: Gary Kim <[email protected]>
1 parent 69f0855 commit c56529d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/components/HypoAssignment.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default {
7070
}),
7171
computed: {
7272
hypo () {
73-
const weight = getInRange(this.assignment.weight, 0, 100, true);
73+
const weight = getInRange(this.assignment.weight, 0, 100, true) || 0;
7474
const new_fp = weight * 0.01 * gradeToFP(this.assignment.grade) + ((100 - weight) * 0.01 * this.currentFP);
7575
return {
7676
fp: new_fp.toFixed(2),

0 commit comments

Comments
 (0)