From 2491b93ea68375547cb44c6f20a1bd85621cd9ee Mon Sep 17 00:00:00 2001 From: Michael Eliachevitch Date: Tue, 26 Sep 2023 06:01:05 +0200 Subject: [PATCH] More sensible lower FSRS progress indicator precision (#2684) It's very helpful having a sub-permille precision in a progress indicator, percent-precision or at most a tenth of a percent should be sufficient for any indicator. But in particular the compute-retention progress has 10 steps, i.e. the progress increases in 10%-intervals (10%, 20%, ...), it *cannot* have sub-decimal progress-percentages, see https://github.com/open-spaced-repetition/fsrs-rs/blob/2d5b19b4941599b1fbc7a49dbbe89774f975e4ed/src/optimal_retention.rs#L365-L368. So there integer percents should be enough, everything else is misleading. The compute-weights progress is currently (as of beta-2) not showing up at all. Maybe if the bug is fixed it can show sub-percent percentages, so for know I changed that to 0.1% precision. But I think integer percentages should be fine here as well, so upon request I can fix that. Also see my comment on this problem in https://forums.ankiweb.net/t/anki-23-10-beta/34912/39. --- CONTRIBUTORS | 1 + ts/deck-options/FsrsOptions.svelte | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c053b30fc..b165b318a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -140,6 +140,7 @@ Michael Winkworth Mateusz Wojewoda Jarrett Ye Sam Waechter +Michael Eliachevitch ******************** diff --git a/ts/deck-options/FsrsOptions.svelte b/ts/deck-options/FsrsOptions.svelte index fe968f972..c40154c0c 100644 --- a/ts/deck-options/FsrsOptions.svelte +++ b/ts/deck-options/FsrsOptions.svelte @@ -166,7 +166,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html if (!val || !val.total) { return ""; } - let pct = ((val.current / val.total) * 100).toFixed(2); + let pct = ((val.current / val.total) * 100).toFixed(1); pct = `${pct}%`; if (val instanceof ComputeRetentionProgress) { return pct; @@ -181,7 +181,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html if (!val || !val.total) { return ""; } - const pct = ((val.current / val.total) * 100).toFixed(2); + const pct = ((val.current / val.total) * 100).toFixed(0); return `${pct}%`; }