cancel
Showing results for 
Search instead for 
Did you mean: 

Trunc function

SOLVED
Contributor

Trunc function

I am trying to use Trunc 

https://support.smartbear.com/testcomplete/docs/reference/language/delphiscript/routines/math/trunc....

it says:

Trunc(FloatValue), so I say Trunc(variable) and it says Trunc is not defined, how do i use this Trunc function?

1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Trunc function

I am jusing java script but Math.trunc(variable) works

3 REPLIES 3
Community Hero

Re: Trunc function

Just want to confirm... the project that you're trying to use this in, is it being developed in DelphiScript?

You can tell if, in a script unit, you see at the bottom of the screen the indication of the script language.  

 

delphiscriptproject.png

 

The reason I ask is because the Trunc function is a DelphiScript only function.  If you're not using DelphiScript, that function is not available to you.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Trunc function

I am jusing java script but Math.trunc(variable) works

Community Hero

Re: Trunc function

Yup, that will do it.  You need to specify the Math object if you're using JavaScript.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
New Here?
Join us and watch the welcome video:
Top Kudoed Authors