From 641ae90cd62ef5ea4a59f7adbc053f130c479a1f Mon Sep 17 00:00:00 2001 From: Dong Date: Wed, 22 Oct 2025 00:45:40 +0800 Subject: [PATCH] settings_ui: Fix IEEE 754 floating point error when serializing value to JSON (#40677) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #40556 Release Notes: - settings-ui: Fixed an issue where modifying floating point number fields could result in the values written to the settings file containing IEEE 754 floating point error > [!Note] > Seems like there's another pull request fixing the centered layout in #40661 by normalizing the whole `settings.json` file when updating it. Not sure which is the better way to handle this issue. ## Description This pull request solves the IEEE 754 floating point error when serializing values from settings-ui into `settings.json` by creating a two `serde_helper` to convert the problematic f32 into a formatted two decimal placed f32. Fields currently exists the IEEE 754 error: - Appearance → Unnecessary Code Fade - Editor → Drop Size Target - Window & Layout → Centered Layout Left/Right Padding - Window & Layout → Inactive Opacity ## How to verify ### Unnecessary Code Fade As Is | To Be --- | ---