cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Thingworx with Javascript math.floor

newieKek
13-Aquamarine

Thingworx with Javascript math.floor

Hello All, 

I am a newbie to the Thingworx, and i like to use the math.floor (random()...) function in the things services. But i am not able to find the math.floor in the snippet. Can anyone show me where i can find how to get the math.xx into the snippet. I am totally lost. 

 

Please help to get me!

 

Thank you!

Newnie Kek

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

It's Math uppercase.

View solution in original post

3 REPLIES 3
posipova
20-Turquoise
(To:newieKek)

You'd be looking at something like 

xyz = Math.random();
result= Math.floor (xyz);

 

Define variable (input) and output basetype 

newieKek
13-Aquamarine
(To:newieKek)

Hihi,

 

Seem like it cannot recognize "math"."Cannot find function Random in object [object Math]".

Any tutorial on how to get the math.x function into my service snippet?

 

Any guidance? Thank you in advance!

 

Best regards 

Newnie Kek

 

 

It's Math uppercase.

Top Tags