Brandon Wong дней назад: 2
Родитель
Сommit
c1eba663b9
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      todo.md

+ 9 - 3
todo.md

@@ -138,11 +138,17 @@ When a cell or range is selected, show a compact set of floating action buttons
 
   By default, the fixed totals row shows the sum of any non-empty column. Clicking on that row's header (the capital sigma symbol on the left) (which should of course have the right "clickable" mouse cursor when hovering) changes it to the average of any non-empty column. Clicking a second time changes it to both the sum and the average (with a smaller font). Clicking a third time changes it back to the sum, and subsequent clicks continue cycling between these modes.
 
-- [ ] **7.3 Column totals row mode**
+- [ ] **7.2.1 Adaptive decimal precision for the average display**
 
-  Idea: the totals row shows the sum by default. Clicking on the header (on the left) swaps it for the average. Either that, or it always shows both, one on top of the other, in smaller font.
+  Sums are shown exactly as computed — no rounding beyond clearing floating-point artifacts (existing `round-for-display` behaviour). Averages, however, can produce long repeating decimals (e.g. `10 / 3`) that are distracting for a "quick calculation" tool. Compromise:
+  - Display precision for a column's average = (the largest number of decimal digits among that column's numeric cells, as **raw typed text** — not the parsed/rounded number) **+ 2**.
+  - All-integer columns (the majority case) therefore show 2 decimal places.
+  - A column with one input typed as e.g. `4.25` (2 decimal digits) shows the average at 4 decimal places.
+  - Cap the result at **6 decimal places total**, regardless of how many decimal digits the input had, so a single messy/edge-case input can't blow up the column's display width.
+  - Basis is the raw string as typed (so `3.00` counts as 2 decimal digits, not 0, since that reflects user intent) rather than the parsed numeric value.
+  - Open question to resolve during implementation: what counts as "raw typed text" for a formula-derived cell, which has no literal decimal string the user typed — likely its computed `:display` value's string form, but worth confirming it doesn't defeat the cap.
 
-- [ ] **7.4 Always-visible row totals column**
+- [ ] **7.3 Always-visible row totals column**
 
   Equivalent pinned column to the right of the table for row aggregates. Perhaps, due to concerns about mobile screen real estate, the row totals could be toggleable (not "always-visible" after all) - maybe behind the row header.