ClaudeMetz/FactoryPlanner

Fix Factorio's rounding of numbers on buttons

Opened this issue · 1 comments

Been an issue since forever, but not super easy to deal with.

There technically is a way for me to pre-format the number so the game shows it correctly, but it'd have to know about the details of how the button formats the number depending on the order of magnitude, which makes it quite complicated and potentially problematic performance-wise since there are a lot of these buttons in the UI.

This could probably be done on all buttons without an option, since it just kinda makes sense. It‘s better to overprovision belts than to underprovision them for machines, for example. At least machine and belt counts should have this, as these are the ones with the rounding option anyways.

Maybe there are other kinds of buttons where this is not desired, and proper rounding should be done instead. The vanilla behavior of showing 1.09 as 1.0 probably doesn‘t make sense anywhere though.

https://discord.com/channels/600791114814980141/600796714558947360/1092120575377408100
https://mods.factorio.com/mod/factoryplanner/discussion/640db4b88e10893c2b9abadd

Relevant PR: #31