From b0d3bf4bd2a19b6665bb61cd8d9abb623b4425e2 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Wed, 6 Nov 2019 21:28:27 -0500 Subject: [PATCH] [+] Encapsulate method to find scale --- src/utils/gpa-utils.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utils/gpa-utils.ts b/src/utils/gpa-utils.ts index 439aaad..4efdf12 100644 --- a/src/utils/gpa-utils.ts +++ b/src/utils/gpa-utils.ts @@ -107,6 +107,16 @@ export class GPAUtils return -1; } + /** + * Find the scale for a grade + * + * @param grade Letter grade or numeric grade + */ + public static findScale(grade: string): Scale | undefined + { + return this.SCALE.find(scale => scale.letter == grade); + } + /** * Calculate the total-mean (total/max) average *