Repository navigation
Print whole credit counts without a decimal point - #1992
Merged
vikrantwiz02 merged 1 commit intoSep 13, 2026
Merged
Conversation
The Grade Validation PDFs showed Units as 1.0, 3.0, 2.0 and the credit totals as 19.0, because the semester builder casts every credit through float and the PDF printed the value as it stood. JSON drops a trailing zero, so the screen was already right and only the generated file was affected. Formatted the same way the client does it: bare when the count is whole, one decimal when it is not, so a half credit course is still printed in full. SPI and CPI keep their one decimal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Grade Validation PDFs from the bulk export printed Units as
1.0,3.0,2.0and the credit totals as19.0._build_grade_validation_semesterscasts every credit throughfloat(), so3becomes3.0, and the PDF printedstr(c["credits"])as it stood. JSON serialisation drops a trailing zero, which is why the on-screen preview was already correct and only the generated file showed it.Added one helper that formats a credit the same way the client's
fmtCreditsalready does — bare when the count is whole, one decimal when it is not, so a half-credit course still prints in full:3.0319.0191.51.5Applied to the Units cell and to the three credit totals in the same table — Total Credits Earned, Semester Credits Earned and Total Registered Credits — since leaving
19.0under a column of1 3 2would read as half-finished. SPI and CPI are untouched and keep their one decimal.Checked against a student's full history: semester 1 now prints units
1 3 2 3 3 2 2 3with totals19 / 19, semester 23 3 2 4 3with15 / 34, semester 3 all3with18 / 52.