Event value as unsigned int
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Event value as unsigned int
Is it possible to take value of event in rule as unsigned integer from given value?
Re: Event value as unsigned int
Have you tried using the [int#n] syntax? I believe it is signed, but avoids float. You can use a rule to handle negative values.
- Thomas
- Thomas
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Event value as unsigned int
[int#n] stands for integer (signed). Of course It is possible to eliminate minus from number in rule. But is any direct way?
Re: Event value as unsigned int
See also the abs conversion: https://espeasy.readthedocs.io/en/lates ... ht=abs#absmackowiakp wrote: ↑19 Mar 2022, 17:41 Is it possible to take value of event in rule as unsigned integer from given value?
Code: Select all
let,1,%eventvalue1%
let,2,abs(%eventvalue1%)
logentry,"This is the integer representation: [int#1]"
logentry,"This is as unsigned int: [int#2]"
-
- Normal user
- Posts: 531
- Joined: 07 Jun 2018, 06:47
- Location: Gdynia/Poland
Re: Event value as unsigned int
Wow! I haven't found the "abs" function anywhere in the documentation. Well, as you can see, it's my mistake.
Thanks TD-er!
Thanks TD-er!
Who is online
Users browsing this forum: No registered users and 137 guests