From c9dbc4b82e37b7b26c85de60ced5d0b9514b23d9 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Tue, 21 Jan 2025 22:41:06 -0300 Subject: [PATCH] round number settings to 5 decimal places --- loader/src/loader/SettingNodeV3.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/loader/src/loader/SettingNodeV3.hpp b/loader/src/loader/SettingNodeV3.hpp index 794379b78..b79ecbd02 100644 --- a/loader/src/loader/SettingNodeV3.hpp +++ b/loader/src/loader/SettingNodeV3.hpp @@ -177,7 +177,8 @@ class NumberSettingNodeV3 : public SettingValueNodeV3 { } if (invoker != m_input) { - m_input->setString(numToString(this->getValue())); + // round to 5 decimal places to avoid floating point errors + m_input->setString(numToString(round(this->getValue() * 100000.0) / 100000.0)); } auto min = this->getSetting()->getMinValue();