How to use a tag variable in a expression tags expression

I want to be able to just type the equipment number in as a variable but I am not for sure how to add it in?

Current expression for a tag

toInt(floor({[.]Downtime1840Timer}/3600)) + ":" + if(toInt(floor(({[.]Downtime1840Timer}%3600)/60))< 10,"0" + toInt(floor(({[.]Downtime1840Timer}%3600)/60)), toInt(floor(({[.]Downtime1840Timer}%3600)/60))) + ":" + if({[.]Downtime1840Timer}%60 < 10, "0" + {[.]Downtime1840Timer}%60, {[.]Downtime1840Timer}%60) 

what I would like to do is make 1840 a variable using equipNbr

equipNbr = 1840

toInt(floor({[.]Downtime*"equipNbr"*Timer}/3600)) + ":" + if(toInt(floor(({[.]Downtime*"equipNbr"*Timer}%3600)/60))< 10,"0" + toInt(floor(({[.]Downtime*"equipNbr"*Timer}%3600)/60)), toInt(floor(({[.]Downtime*"equipNbr"*Timer}%3600)/60))) + ":" + if({[.]Downtime*"equipNbr"*Timer}%60 < 10, "0" + {[.]Downtime*"equipNbr"*Timer}%60, {[.]Downtime*"equipNbr"*Timer}%60) 

Check out the “tag” function: tag - Ignition User Manual 8.1 - Ignition Documentation

If this expression is on a window, you might want to consider using a custom property bound to an indirect tag, then use the custom property in your expression.

the expression in part of the tag not a window

There are no such things as variables I nthe expression language, as others have suggested, you’ll need to use the tag function to read the tag value from a string tag path. Tag paths inside of braces are direct links to explicit tags and cannot be made dynamic (other than by using relative referencing which makes it semi-dybamic).

toInt(floor(tag('[.]Downtime' + str(1840) + 'Timer') /3600))

Where is your equip number supposed to be coming from? Is your tag part of a udt?

I have 4 tags for each piece of equipment, one of those tags uses the expression above. I just copy the 4 tags for a new piece of equipment each time and then change the equipNbr. With that setup it just takes a long time to change the equipNbr in every location needed, Just looking for away to shorten the amount of steps it takes for each one. I don’t have it setup as a udt. But that might be a better way.

Sounds like you should be using a udt as this is exactly what they’re designed for. In that case, you should just be able to reference the tag directly without any indirection in your expression, as the tags will always have the same name in the UDT.

Also, I just actually read your expression to see what you were actually doing, and the easiest way to 0-pad a number is using numberFormat
E.g.
numberFormat(4, '00')

Rather than using an if statement.
The second easiest way is using right
right("00" + str(7), 2)