# Integer division

**URL:** <https://forum.inductiveautomation.com/t/integer-division/14163>\
**Category:** General Discussion\
**Created:** [April 28, 2017, 9:00am UTC](https://forum.inductiveautomation.com/t/integer-division/14163 "2017-04-28T09:00:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johan.volders](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@johan.volders](https://forum.inductiveautomation.com/u/johan.volders)\
**Post date:** [April 28, 2017, 9:00am UTC](https://forum.inductiveautomation.com/t/integer-division/14163/1 "2017-04-28T09:00:34Z")

</div>

In the Ignition designer I choose for a numeric text field as type Integer, and as Integer value the expression 1 / 2  
I would expect the value shown in the text field would be 0 (like it does in C, Java…) but the result shown is rounded up to 1  
Why works integer division different, is it some setting ?

---

<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:** [April 28, 2017, 1:26pm UTC](https://forum.inductiveautomation.com/t/integer-division/14163/2 "2017-04-28T13:26:47Z")

</div>

I would suggest if you want full control over rounding you do it yourself before the tag gets a chance to cast the value, as it seems the tag system is inconsistent in this regard.

In the expression language everything is a double, so applying the `floor` expression here will get you the result you’re looking for.
