Make sprite-button.number round instead of truncate

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 208
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Make sprite-button.number round instead of truncate

Post by Therenas »

Currently, when settings a number on sprite-buttons, it formats it in a nice way so it fits on the button. That part is fine. What is not optimal imo is that the number just gets truncated. So when you set a number to 138.9999, is shows as 138, which it shouldn't I think, that is just wrong. Applying normal rounding to the number would be more what you'd expect.

Rseding91
Factorio Staff
Factorio Staff
Posts: 11923
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Make sprite-button.number round instead of truncate

Post by Rseding91 »

You know you could just round the number yourself right?
If you want to get ahold of me I'm almost always on Discord.

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 208
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Make sprite-button.number round instead of truncate

Post by Therenas »

I do, but wouldn't it be nice if the button behaved nicely out of the box? Also, I'd have to round it to the exact number of digits that the button would show, which is not trivial I think.

Post Reply

Return to “Modding interface requests”