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