# \[BUG-11697\] Round function not working on tag values in expressions

**URL:** <https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416>\
**Category:** Ignition Early Access\
**Created:** [February 7, 2019, 3:27pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416 "2019-02-07T15:27:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [February 7, 2019, 3:27pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/1 "2019-02-07T15:27:24Z")

</div>

I might be doing something wrong. I am trying to force 1 decimal place on a value I am displaying on a label in Perspective module. I am using a tag with the float data type.

The tag “[default]Test Float” has a value of 1.23456789

This expression returns 1.23456789  
{[default]Test Float}

This expression returns “Error\_Configuration”  
round({[default]Test Float}, 1)

This expression returns 1.2  
round(1.234, 1)

This expression returns “1.23456789”  
tag("[default]Test Float")

This expression returns “Error\_Configuration”  
round(tag("[default]Test Float"), 1)

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [February 7, 2019, 3:30pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/2 "2019-02-07T15:30:34Z")

</div>

You might have to cast the tag as a float. Try something like:

```auto
round(toFloat(tag("[default]Test Float")), 1)
```

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [February 7, 2019, 3:36pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/3 "2019-02-07T15:36:56Z")

</div>

Weird… it’s already a float but these 2 work.

round(toFloat({[default]Test Float}), 1)

round(toFloat(tag("[default]Test Float")), 1)

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 7, 2019, 3:38pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/4 "2019-02-07T15:38:14Z")

</div>

Hmm. Does this work without the cast in 7.9?

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [February 7, 2019, 3:44pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/5 "2019-02-07T15:44:58Z")

</div>

I don’t have a 7.9 instance to test on currently. I’m not sure. I don’t recall having a problem in the past but most of my Ignition work lately has been with SQL Bridge and alarm notification.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 7, 2019, 3:48pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/6 "2019-02-07T15:48:39Z")

</div>

Ok we’ll look into it. Might be a bug.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 7, 2019, 4:53pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/7 "2019-02-07T16:53:33Z")

</div>

Yep, we’re already tracking this one. It’s not just the round function, it’s a more general problem in expressions.

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [February 7, 2019, 4:56pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/8 "2019-02-07T16:56:34Z")

</div>

For further clarification (and to track all of the Expression issues in one thread), the Expression with problems we are aware of are:

- **Aggregates** \> **maxDate** & **minDate**
- All **Database** functions
- All **Store and Forward** functions
- **Logic \> coalesce**
- **Logic \> hasChanged**
- **Math \> pow**
- **Math \> round**
- **String \> split**

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [February 7, 2019, 5:05pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/9 "2019-02-07T17:05:15Z")

</div>

Excellent, thank you.

At least we have a work around.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 7, 2019, 9:55pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/10 "2019-02-07T21:55:28Z")

</div>

There’s a fair number of places I’ve had to use toInt() with integer constants.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 7, 2019, 9:56pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/11 "2019-02-07T21:56:45Z")

</div>

> [@pturmel](#):
>
> There’s a fair number of places I’ve had to use toInt() with integer constants.

Removing the type restrictions on expressions (and just attempting to coerce in all cases) is on the roadmap.

---

<div class="post-metadata">

**Author:** ![awalker](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awalker/32/6874_2.png) [@awalker](https://forum.inductiveautomation.com/u/awalker)\
**Post date:** [March 12, 2019, 8:33pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/12 "2019-03-12T20:33:29Z")

</div>

This issue was fixed in the build that was uploaded today (3/12). Please let us know if you continue to see this behavior after upgrading.

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [March 13, 2019, 2:09pm UTC](https://forum.inductiveautomation.com/t/bug-11697-round-function-not-working-on-tag-values-in-expressions/22416/13 "2019-03-13T14:09:18Z")

</div>

Will do.

Thank you.

Oh, I need to type 20 characters to post.
