]> git.earman.xyz Git - sensor-watch.git/commitdiff
Fix ppm fractional display on finetune Frq page
authorTim Douglas <me@timdoug.com>
Wed, 27 May 2026 03:05:58 +0000 (23:05 -0400)
committerTim Douglas <me@timdoug.com>
Wed, 27 May 2026 03:15:06 +0000 (23:15 -0400)
The Frq page used remainderf to extract the fractional part of the
correction value, but remainderf rounds to the nearest integer and
returns negative results when the fraction exceeds 0.5. This caused
values like 0.965 ppm to render as " 0-350" instead of " 09650".
Switch to fmodf, matching the DELtA page above.

watch-faces/settings/finetune_face.c

index fe75d8fa4ecabd9cf1eb431104005a7770c0bf05..3cc7262e2e6713295d4821c64f2ad8f5d1049788 100644 (file)
@@ -87,7 +87,7 @@ static void finetune_update_display(void) {
             float correction = finetune_get_correction();
             watch_display_text(WATCH_POSITION_TOP_RIGHT, (total_adjustment < 0) ? " -" : "  ");
 
-            sprintf(buf, "%2d%04d", (int)fabsf(correction), (int)(remainderf(fabsf(correction), 1.) * 10000));
+            sprintf(buf, "%2d%04d", (int)fabsf(correction), (int)(fmodf(fabsf(correction), 1.) * 10000));
             watch_display_text(WATCH_POSITION_BOTTOM, buf);
         }
     }