Ask a Question

Trunc function

SOLVED
4m4d3u5
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
4m4d3u5
Contributor

Re: Trunc function

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

View solution in original post

3 REPLIES 3
tristaanogre
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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
4m4d3u5
Contributor

Re: Trunc function

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

View solution in original post

tristaanogre
Community Hero

Re: Trunc function

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


Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: