Rounding start values - #3488
Open
jort-wolda wants to merge 1 commit into
Open
jort-wolda wants to merge 1 commit into
jort-wolda wants to merge 1 commit into
Conversation
Rounding the start values of the shares of residences per construction type
jort-wolda
marked this pull request as ready for review
September 9, 2026 14:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The new residences can result in long floats when you do not change the shares of residences built per construction type:

While the shares can only be set using 1 decimal, the starting values are the result of queries calculating the value based on the dataset. These starting values actually have many more decimals in the back-end.
When you round these starting values to 1 decimal you potentially get this error when you changed the inputs and want to reset to the starting values:

This is a rounding error and etengine can't balance the sliders to be 100% because they are all defined based on their start-value query.
A solution that works is rounding to 2 decimals. Adding up the values shown in the front end still results in 100.1% but the back-end value with slightly more precision makes it close enough to 100% for etengine to not result in an error. The extremely long floats are thereby reduced to a maximum of 4 decimals.
Implemented changes
Rounded the input values to 2 decimals for:
Related
Checklist