FactoryPlanner icon indicating copy to clipboard operation
FactoryPlanner copied to clipboard

Fix Factorio's rounding of numbers on buttons

Open ClaudeMetz opened this issue 2 years ago • 5 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

ClaudeMetz avatar Jul 24 '23 08:07 ClaudeMetz

Relevant PR: #31

ClaudeMetz avatar Sep 26 '24 12:09 ClaudeMetz

Bump. I don't know how you prioritize your tasks, but could you please put this somewhere closer to the top of your to-do list? :) See the attached screenshot. Just looking at the number on the button I assumed I needed 1 machine, but it didn't work properly, took me a while to realize I needed to hover the button to see the exact number. I'd expect to see 2 machines on the button in this case (might be an optional setting), since that's the number I actually need for the production line to run properly. Thanks!

Image

nonodesu avatar Oct 27 '25 07:10 nonodesu

Prioritization is a tricky topic, there's just so many important things to do. This one isn't too far down the list, but that's not saying much. Anyways, I agree it should be implemented.

Your specific case where you want it to show 2 I'm not as sure about. The compact dialog does this rounding up, as that's the interface you normally 'build from'. I don't think the main interface should necessarily do it too. It should show 1.1 there probably though.

ClaudeMetz avatar Oct 27 '25 07:10 ClaudeMetz

Your specific case where you want it to show 2 I'm not as sure about.

It would be awesome to have an option in the settings so people can choose what they want, though I understand that would take longer to develop. For me personally, seeing decimal machine numbers does nothing useful, it's basically just noise.

nonodesu avatar Oct 27 '25 08:10 nonodesu

Yeah I actually had an option for this in the past, but it wasn't used very much so I got rid of it when I rewrote some related code. The argument for it is that you can see how much of a fractional machine you are using, and whether you might want to adjust some amounts with regards to that.

ClaudeMetz avatar Oct 27 '25 12:10 ClaudeMetz