Page 3 of 3

Allow for Math to be used in Number Fields

Posted: Mon Nov 21, 2022 5:40 pm
by Proxy
A lot of productivity programs like Kicad, GIMP (or even games like Satisfactory) allow you to do math inside of text certain fields.
example from GIMP:


And when you're used to programs that have it, you'll start to notice it being missing. so i thought i'd suggest the idea here!
one example i can think of for Factorio is:
you have 4 assemblers feeding of a requester chest, using SHIFT+LMB to set the requester's item would only request enough for a single assembler. so it would be convenient if you could just click on the item in the requester, and in the number field next to the slider, enter "*4" (multiply by 4), then click the confirm button to have it automatically evaluate that and save it as the new item count.

Re: Allow for Math to be used in Number Fields

Posted: Wed Nov 23, 2022 4:14 pm
by Factoruser
Extremely smart idea, although not THAT much useful for Factorio...

Re: Hex signal view, hex and mathematical input in constants

Posted: Fri Nov 25, 2022 5:38 am
by ssilk
that was similar enough for me to join it with this topic…

I think the idea can be quite useful.

Combinators: Allow more way to input numbers

Posted: Tue Nov 21, 2023 8:22 pm
by DarkShadow44
TL;DR
Give the number box the ability to parse simple math equations and hex numbers.

What ?
When using combinators you often need to add some constant:
Image

It would be useful if we could set numbers like "80*8+4", press enter and have the game automatically convert it to 644.
Same thing for hex numbers, would be nice to just write 0xFFFF and have it converted to 65535. Would be very useful for bit operations.

Re: Combinators: Allow more way to input numbers

Posted: Tue Nov 21, 2023 8:44 pm
by BaggyK
Related suggestion threads:

viewtopic.php?f=6&t=50305 Allow hexadecimal entry for constant values in combinators
viewtopic.php?f=6&t=14686 Accept hexadecimal input for numbers
viewtopic.php?f=6&t=53999 Suggetion: Binary combinator variables

Re: Combinators: Allow more way to input numbers

Posted: Wed Nov 22, 2023 7:15 am
by aka13
That would be very cool, especially the bit keyboard.
I use helper excel tables for input otherwise, which is pretty cumbersome.

Re: Combinators: Allow more way to input numbers

Posted: Wed Nov 22, 2023 5:09 pm
by Hares
+1 on that

Re: Combinators: Allow more way to input numbers

Posted: Sat Dec 02, 2023 5:55 am
by Roxor128
Adding onto this, an option to view as hexadecimal would be useful as well. Much easier to pick out your packed values from hexadecimal than decimal.

Re: Combinators: Allow more way to input numbers

Posted: Sat Dec 02, 2023 10:47 am
by Illiander42
Another +1.

Helmod does this with it's "how much do you want" field.

Re: Combinators: Allow more way to input numbers

Posted: Fri Dec 08, 2023 7:32 pm
by DarkShadow44
With FFF 388 this is confirmed part of the expansion. Anyone knows if Hex is a thing as well?

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Fri Dec 22, 2023 10:15 am
by OADINC
It only took 2 years, but according to FFF-388 it is going to be implemented!

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Fri Dec 22, 2023 10:35 am
by Freddy404
Not to seem ungrateful, but hexadecimal input seems to be still missing. Which was mentioned in the original suggestion here, and several times in the FFF thread. Because it would make bit masks and similar computation-related constants a lot easier to input.

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Wed Oct 23, 2024 10:20 pm
by OADINC
Good news I just confirmed that both features are now in the game! As of 2.0

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Thu Oct 24, 2024 5:43 am
by Koub
[Koub] Thanks for the catch, moved to implemented

Add hexadecimal support to number fields

Posted: Thu Oct 02, 2025 3:37 am
by HeliGungir
TL;DR
hex.png
hex.png (621.92 KiB) Viewed 140 times
What?
Please add hexadecimal support to number fields. Particularly in logistic groups, combinators, and machine controls.
  • One option would be a "0x" prefix, eg: 0x7FFFFFFF
  • Another option would be an "h" postfix, eg: 7FFFFFFFh
The second option is one less keystroke, but it collides with the "h" SI prefix (hecto). Factorio currently supports the larger SI prefixes k, M, and G; but not h. So for an end-user, there would ambiguity about whether h should mean "hecto" or "hexadecimal"
Why?
When working with signals and control logic, it's a lot easier to remember the largest positive number and smallest negative number are 7FFFFFFF and 80000000 (in hexadecimal) than 2147483647 and -2147483648 (in decimal).

Hexadecimal is also helpful for typing out bitwise masks. More helpful than decimal, anyway...

Re: Add hexadecimal support to number fields

Posted: Thu Oct 02, 2025 3:40 am
by eugenekay

Re: Add hexadecimal support to number fields

Posted: Thu Oct 02, 2025 3:45 am
by eugenekay
Also, feature exists?
10-01-2025, 23-44-21.png
10-01-2025, 23-44-21.png (22.78 KiB) Viewed 130 times
10-01-2025, 23-44-42.png
10-01-2025, 23-44-42.png (16.95 KiB) Viewed 130 times
The expression is computed after de-selecting the Input field. It even works with addition/subtraction:
10-01-2025, 23-46-15.png
10-01-2025, 23-46-15.png (16.83 KiB) Viewed 130 times
10-01-2025, 23-46-32.png
10-01-2025, 23-46-32.png (14.57 KiB) Viewed 130 times
Related: MathExpression


Good Luck!

Re: Add hexadecimal support to number fields

Posted: Thu Oct 02, 2025 4:58 am
by BrainGamer_
The important thing to note is that hex numbers must be in lowercase, so 0xff instead of 0xFF.

Re: Accept hexadecimal input for numbers / Add the ability to type "16k" so it autocompletes to "16000"

Posted: Thu Oct 02, 2025 8:04 am
by Koub
[Koub] Merged several threads with the same (already implemented) suggestion.