Methods for round down, round up, and round off small number values.(Power Automate Desktop)

Japanese version.

This section shows how to round down, round up, and round off to the nearest whole number.

Steps

Use the "Run JavaScript" action.

Each JavaScript method used is a function that rounds decimal places to integers.

When rounding to the nearest whole number, multiply by a multiple of 10 before using the method, and divide the result back by the multiple of 10.

Round off

Use JavaScript's Math.round method.

WScript.StdOut.Write( Math.round(%Numric%) )

Round up/down

The following methods are used.

MethodDescription
Math.ceilRound up.
Math.floorRound down.(Negative numbers will be the smaller integer)
Math.truncRound down.(Negative numbers will be the larger integer)
WScript.StdOut.Write( Math.ceil(%Numric%) ) 
WScript.StdOut.Write( Math.floor(%Numric%) ) 
WScript.StdOut.Write( Math.trunc(%Numric%) )

Both floor and trunc are truncated, but the results are different for negative numbers.

Numricfloortrunc
4.544
-4.5-5-4

For those who want to learn Power Automate Desktop effectively


The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.

Links

Tips(Power Automate Desktop)