Skip to content

Commit

Permalink
round number settings to 5 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Jan 22, 2025
1 parent ae12993 commit c9dbc4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion loader/src/loader/SettingNodeV3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ class NumberSettingNodeV3 : public SettingValueNodeV3<S> {
}

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();
Expand Down

0 comments on commit c9dbc4b

Please sign in to comment.