/
How to round a number to a certain number of decimal points within a ZebraTester Inline Script
How to round a number to a certain number of decimal points within a ZebraTester Inline Script
It is possible to implement rounding of numbers within a ZebraTester script by converting the given number to a string and then creating a substring of the value out of the first number in the string and the number after the desired rounding place. Consider the following example:
a = "1.624000000000002"
b = strSubString(a,"1","4")
print b #this is a comment as denoted by the # character - "b" is now 1.62
In the above example, strSubString method uses “1” and the “4” in “1.624” to create a new value shortened to the value before “4” - that is, 1.62.
, multiple selections available,
Related content
How to Move a ZebraTester Script to an Older Format
How to Move a ZebraTester Script to an Older Format
More like this
How to Convert a HAR file into a ZebraTester Script
How to Convert a HAR file into a ZebraTester Script
More like this
Editing ZebraTester Checks
Editing ZebraTester Checks
More like this
Understanding ZebraTester Check Results
Understanding ZebraTester Check Results
More like this
How to Use a Custom DNS Host File Within a ZebraTester Script
How to Use a Custom DNS Host File Within a ZebraTester Script
More like this
Core ZebraTester V7.0-A Documentation
Core ZebraTester V7.0-A Documentation
More like this
Can't find what you're looking for? Send an E-mail to support@apica.io