# How to clamp an int?

**URL:** <https://forums.unrealengine.com/t/how-to-clamp-an-int/367728>\
**Category:** Blueprint\
**Tags:** integer, unreal-engine, clamp, Blueprint, question\
**Created:** [August 20, 2016, 3:22pm UTC](https://forums.unrealengine.com/t/how-to-clamp-an-int/367728 "2016-08-20T15:22:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DE4Dkiller616\_MC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DE4Dkiller616\_MC](https://forums.unrealengine.com/u/DE4Dkiller616_MC)\
**Post date:** [August 20, 2016, 3:22pm UTC](https://forums.unrealengine.com/t/how-to-clamp-an-int/367728/1 "2016-08-20T15:22:26Z")

</div>

I am using blueprints to clamp an int variable, the min is 0 and max is 45, but i always get as min -1 and as max 46.

why does this happen? how can i solve it? this didnt happen in 4.10 and 4.11

thanks for taking the time!

---

<div class="post-metadata">

**Author:** ![VictorBurgos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/victorburgos/32/1008648_2.png) [@VictorBurgos](https://forums.unrealengine.com/u/VictorBurgos)\
**Post date:** [August 20, 2016, 3:26pm UTC](https://forums.unrealengine.com/t/how-to-clamp-an-int/367728/2 "2016-08-20T15:26:53Z")

</div>

Show the blueprint please.

---

<div class="post-metadata">

**Author:** ![DE4Dkiller616\_MC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DE4Dkiller616\_MC](https://forums.unrealengine.com/u/DE4Dkiller616_MC)\
**Post date:** [August 20, 2016, 3:32pm UTC](https://forums.unrealengine.com/t/how-to-clamp-an-int/367728/3 "2016-08-20T15:32:41Z")

</div>

ups, sorry, just fixed that by making the clamp out of the event tick so now the number is like flashing up to 46 and again to 45, but i clamped in the widget and it got fixed, sorry, just figured this out after posting it
