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:
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.
PreviousHow to iterate over JSON objects in ZebraTester using Inline ScriptsNextHow to Use a Custom DNS Host File Within a ZebraTester Script
Was this helpful?