Files
RuvdsTest/src/Client/Shared/Format.fs
danamir 942dfc9c1a Initial commit: standalone quiz-testing system
Full-stack F# (Domain/Server/Client via Fable+Elmish+Feliz), PostgreSQL
persistence via Dapper, Docker Compose deployment. Student quiz-taking flow
with time-limit enforcement and focus-loss tracking, Teacher question bank
and quiz builder with results analytics, Admin user management.
2026-08-06 12:36:16 +03:00

13 lines
524 B
Forth

module Client.Shared.Format
/// Whole-numbered points render without a decimal point ("3"); anything with
/// a fractional part renders with one decimal place ("2.5") points are
/// usually whole in this app, but `AverageAttempt` grading or a partial-point
/// question config can produce a fractional value that a blanket "%.0f"
/// would otherwise silently round away.
let points (value: float) : string =
if value = System.Math.Round value then
sprintf "%.0f" value
else
sprintf "%.1f" value