From c56529d75eb11beea0b3ca449f40d053b4689ea9 Mon Sep 17 00:00:00 2001 From: Gary Kim Date: Wed, 18 Mar 2020 07:57:01 +0800 Subject: [PATCH] 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 --- src/js/components/HypoAssignment.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/components/HypoAssignment.vue b/src/js/components/HypoAssignment.vue index 58da9540..cf0f47a4 100644 --- a/src/js/components/HypoAssignment.vue +++ b/src/js/components/HypoAssignment.vue @@ -70,7 +70,7 @@ export default { }), computed: { hypo () { - const weight = getInRange(this.assignment.weight, 0, 100, true); + const weight = getInRange(this.assignment.weight, 0, 100, true) || 0; const new_fp = weight * 0.01 * gradeToFP(this.assignment.grade) + ((100 - weight) * 0.01 * this.currentFP); return { fp: new_fp.toFixed(2),