# Set upper and lower limits for a variable

**URL:** <https://community.homey.app/t/set-upper-and-lower-limits-for-a-variable/119981>\
**Category:** Questions & Help\
**Created:** [November 7, 2024, 1:48pm UTC](https://community.homey.app/t/set-upper-and-lower-limits-for-a-variable/119981 "2024-11-07T13:48:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [November 7, 2024, 5:01pm UTC](https://community.homey.app/t/set-upper-and-lower-limits-for-a-variable/119981/2 "2024-11-07T17:01:38Z")

</div>

This works  
`{{ min(max([value],100),2000) }}`

 ![image18](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/d/2d26390beb9e4a7472cc966b33ff3717b7263493.png)

So when I replace the example value `15000` with your calculation, it should be like this:

 ![Screenshot_20241107_175007_Firefox](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/6/1674cb2a967dc3ab3025dce421033bdd757cb18e.jpeg)

---

_[View the full topic](https://community.homey.app/t/set-upper-and-lower-limits-for-a-variable/119981)._
