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.
13 lines
524 B
Forth
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
|