ToInteger() problem

Post Reply
flp
Posts: 51
Joined: Tue Sep 02, 2014 12:54 am

ToInteger() problem

Post by flp » Fri Nov 14, 2014 3:03 pm

When I call the ToInteger() function for a value like 3.67, I always receive 3.0.

For me that doesn't look like an integer, it's rather an double with a 0 decimal position.

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: ToInteger() problem

Post by Marco Grawunder » Mon Nov 17, 2014 9:41 am

With the followinq query

Code: Select all

#PARSER PQL
#ADDQUERY
trigger = ASSUREHEARTBEAT({
              realtimedelay = 1000,
              applicationtimedelay = 1000                        
            }                    
          )
          
output = MAP({
              expressions = [['toInteger(3.67)','value']],
              evaluateonpunctuation = true                        
            },
            trigger
          )
I get 3 ... Could you please post the query, where you receive 3.0.

flp
Posts: 51
Joined: Tue Sep 02, 2014 12:54 am

Re: ToInteger() problem

Post by flp » Mon Nov 17, 2014 4:40 pm


User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: ToInteger() problem

Post by Marco Grawunder » Mon Nov 17, 2014 6:45 pm

Code: Select all

(ToInteger
  (
    (player_hit_timestamp - 10753295594424116)
   /60000000000000
  ) 
+ 1
)
The problem is the + operator. In the current implementation it will always create an double value. If you place the +1 inside the brackets you will get an integer value :-)

flp
Posts: 51
Joined: Tue Sep 02, 2014 12:54 am

Re: ToInteger() problem

Post by flp » Tue Nov 18, 2014 3:01 am

That's nothing I would expect, when I add an integer to an integer :/

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: ToInteger() problem

Post by Marco Grawunder » Tue Nov 18, 2014 9:22 am

Sure :-) Real handling of integer is not part of Odysseus so long. I will try to fix that problem, but that takes some time.

flp
Posts: 51
Joined: Tue Sep 02, 2014 12:54 am

Re: ToInteger() problem

Post by flp » Tue Nov 18, 2014 1:53 pm

Yeah, I understand that. Maybe you can place a hint for the + in the documentation. That should help to avoid this problem.

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: ToInteger() problem

Post by Marco Grawunder » Tue Nov 18, 2014 1:59 pm

Good idea!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest