Rounding up results

I’m new to UI Vision and could use some help with rounding. I’m interacting with a web page that can display 100 records at a time. I’m able to count the number of records in the datasource.

I need to divide the number of records by 100 and then round the result to the next higher number.

For example, if I have 325 records and divide by 100, the result is 3.25. I need to round the result to 4. That way, I know I have to click the “next” button 3 times to display the 4 different pages.

I saw a question about round to the nearest 100 but in my situation, I need to round up to the next whole number.

Any help would be greatly appreciated. Thank you.

  1. You can run Javascript with the executeScript_Sandbox command

  2. For the JS code itself, you can ask ChatGPT to generate it for you :wink: If you do this, make sure to tell ChatGPT (or Bard or Claude etc) to generate ES5 compatible Javascript code. I do this all the time now and then copy and paste the result into the executeScript_Sandbox command :wink:

1 Like

@ulrich…Thanks for the suggestion. Works great. Appreciate the help…

1 Like