Skip to main content
14-Alexandrite
April 2, 2019
Solved

Thingworx with Javascript math.floor

  • April 2, 2019
  • 2 replies
  • 2180 views

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

 

 

Best answer by CarlesColl

It's Math uppercase.

2 replies

20-Turquoise
April 4, 2019

You'd be looking at something like 

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

 

Define variable (input) and output basetype 

newieKek14-AlexandriteAuthor
14-Alexandrite
April 9, 2019

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

 

 

1-Visitor
April 9, 2019

It's Math uppercase.