Each of these solutions also expects you to be able to add these tools to the context, which I do not know how to do. Due to limitations and restrictions in our environment, I have to be able to do everything with an out-of-the-box instance of Confluence Server and of Scroll Viewport. If there is a syntax for adding those classes to a vm using Scroll Viewport, I would be happy to try it out. But even things that are supposed to be available to me according to Confluence's documentation are not in Viewport, like generalUtils.
If you can see a way to get it going, a two-line template should be enough to show it works:
## line 1: include whatever is needed to add rounding to the page, if necessary
## line 2: the command to round the number 1.5
For instance, if this worked, it would be enough to show it in action:
$context.put("Math", Math.class);
#Math.round(1.5)
Thanks for looking at it.