1.6.80 • Published 2 years ago
gpa
Licence
ISC
Version
1.6.80
Deps
0
Size
3 kB
Vulns
0
Weekly
0
README
Description
This module convert gpa between int and string value
Install
Go into a node project and type the following :
__CODE_BLOCK_0__gt; npm install gpa
Exemple
import gpa from 'gpa';
console.log(gpa('A+')); // display : 17
console.log(gpa(10)); // display : C
Run
__CODE_BLOCK_2__gt; node server.js
correlation table
| grade | number |
|---|---|
| F- | 0 |
| F | 1 |
| F+ | 2 |
| E- | 3 |
| E | 4 |
| E+ | 5 |
| D- | 6 |
| D | 7 |
| D+ | 8 |
| C- | 9 |
| C | 10 |
| C+ | 11 |
| B- | 12 |
| B | 13 |
| B+ | 14 |
| A- | 15 |
| A | 16 |
| A+ | 17 |
edge cases :
gpa('') => -1
gpa(78) => ''