Skip to content

Print whole credit counts without a decimal point - #1992

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:grade-validation-units
Sep 13, 2026
Merged

vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:grade-validation-units

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

The Grade Validation PDFs from the bulk export printed Units as 1.0, 3.0, 2.0 and the credit totals as 19.0.

_build_grade_validation_semesters casts every credit through float(), so 3 becomes 3.0, and the PDF printed str(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 fmtCredits already does — bare when the count is whole, one decimal when it is not, so a half-credit course still prints in full:

Value Printed
3.0 3
19.0 19
1.5 1.5

Applied 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.0 under a column of 1 3 2 would 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 3 with totals 19 / 19, semester 2 3 3 2 4 3 with 15 / 34, semester 3 all 3 with 18 / 52.

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.
@vikrantwiz02
vikrantwiz02 merged commit e49f2d2 into FusionIIIT:prod/acad-react Sep 13, 2026
1 check passed
@vikrantwiz02
vikrantwiz02 deleted the grade-validation-units branch September 13, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant