# Get started with rules:string /number / integer

**URL:** <https://community.openhab.org/t/get-started-with-rules-string-number-integer/2877>\
**Category:** Beginners\
**Created:** [September 28, 2015, 6:47pm UTC](https://community.openhab.org/t/get-started-with-rules-string-number-integer/2877 "2015-09-28T18:47:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![watou](https://community.openhab.org/user_avatar/community.openhab.org/watou/32/70595_2.png) [@watou](https://community.openhab.org/u/watou)\
**Post date:** [September 28, 2015, 10:05pm UTC](https://community.openhab.org/t/get-started-with-rules-string-number-integer/2877/4 "2015-09-28T22:05:08Z")

</div>

The current state of `Studie_Max_Act` is undefined when you are trying to use it as a `DecimalType`. You could either use a persistence service to save and restore its previous state, or put a check in your rule to make sure it is currently a numeric value:

```java
if (Studie_Max_Act.state instanceof DecimalType) {
  var int B = (Studie_Max_Act.state as DecimalType).intValue
  // or however you want to use it
}

```

---

_[View the full topic](https://community.openhab.org/t/get-started-with-rules-string-number-integer/2877)._
