Round(tag,0) works on one tag but not on another

Hello, I’m trying to use round(tag,0) to remove decimal from floats. So instead of 18.0 it only shows 18.

In one project for one tag it works flawlessly. But in another project for a different tag, it refuses to work. The one it will not work on is a brand new device I just put on, so I know nothing is overriding it.

any ideas why it refuses to work?

Thank you in advance, I appreciate the help.

I wouldn’t expect rounding by itself to accomplish what you want.

I’d expect this is a matter of display format string and possibly the DataType of the expression tag you’re using the round function in, if that’s the context we’re talking about.

@Kevin.Herron in this gif below you can see it working.

and in what context does it not work?

@Kevin.Herron see below GIF

In this case you’re just doing string concatenation, which is going to end up using “2365.0” because the result of the round function is still a floating point value of 2365.0. In the other case the LED display was taking care of not showing the decimal.

Try using toInt(round(...)) instead.

1 Like

@Kevin.Herron thank you, it worked. I tried something similar but my code was a bit off.