[+] Encapsulate method to get GPA string

This commit is contained in:
Hykilpikonna
2019-09-16 22:24:47 -04:00
parent cbec0add3b
commit 2beca45e38
+15
View File
@@ -1,6 +1,7 @@
import {Component, Prop, Vue} from 'vue-property-decorator';
import GraphOverall from '@/pages/overall/graph-overall/graph-overall';
import {Course} from '@/components/app/app';
import {GPAUtils} from '@/utils/gpa-utils';
@Component({
components: {GraphOverall}
@@ -95,4 +96,18 @@ export default class Overall extends Vue
rows: rows
}
}
public getGPA()
{
let gpa = GPAUtils.getGPA(this.courses);
let result = '' + gpa.gpa;
// Not accurate
if (!gpa.accurate)
{
result = `(${result})`;
}
return result;
}
}