# Power Automate: How to Round a Number

> For the full documentation index, see https://250highstreet.com/llms.txt

> Power Automate has no round() in the Math list. Use formatNumber() with int() or float() to round to whole numbers or two decimals, and test your own values.

Wrap the number in formatNumber() with a format string, then convert the text back with int() or float(). For a whole number, write int(formatNumber(variables('Total'), '#0')). For two decimals, write float(formatNumber(variables('Total'), '0.00')).

## Does Power Automate have a round function?

Not in the Math group of the expression editor. Community guides on rounding in Power Automate say there is no native round function and use other functions to get the same result.

The usual fix is formatNumber(). It takes a number, a format string and an optional locale, and it returns text.

## How do you round to a whole number?

formatNumber() returns text, so the int() wrapper turns the result back into a number. Test a value that ends in .5 and a value that ends in .4 before you rely on the result.

1.  Place a Compose action below the step that holds your number.
2.  Click inside its input, then switch to the Expression tab.
3.  Enter int(formatNumber(variables('Total'), '#0')), using your own variable or dynamic value.
4.  Choose Add, then save the flow and run it.
5.  Look at the Compose result in run history.

## How do you round to two decimal places?

Use a format string with two zeros after the point: formatNumber(variables('Price'), '0.00'). The format 'N2' also gives two decimals but adds thousands separators, so do not wrap it in float(): the comma in 1,234.50 makes the conversion fail.

To keep the result as a number, wrap it: float(formatNumber(variables('Price'), '0.00')). Read [how to convert text to a number with int() and float()](/guides/power-automate-convert-text-to-number-int-float/) for the difference between the two.

Sources disagree on whether formatNumber() rounds a midpoint value such as 1.995 or only formats it. Run your own values through a test flow and check the output.

## What if you need to round up or round down?

formatNumber() rounds to the nearest value, so it does not round up or down on its own. For a positive number, mod(value, 1) gives the part after the point. Round down with sub(variables('Total'), mod(variables('Total'), 1)). Round up with if(greater(mod(variables('Total'), 1), 0), add(sub(variables('Total'), mod(variables('Total'), 1)), 1), variables('Total')).

Test with a negative number as well. mod() keeps the sign of the value, so negative numbers round the other way.

## How do you show the rounded number as money or a percentage?

Use a format string that matches the display you want. [The currency guide](/guides/power-automate-format-number-as-currency/) covers dollar signs and locale.

Round first when the number feeds a later calculation. Format only at the last step, such as an email body, so you do not lose precision halfway through the flow.

## Why does the expression fail with an error about null?

An empty SharePoint number column returns null, and formatNumber() cannot format null. Read [the invalid type error about null](/guides/power-automate-invalid-type-expected-string-but-got-null/) and guard the input: formatNumber(coalesce(variables('Total'), 0), '0.00').

To test for a blank value first, see [how to test for an empty field](/guides/power-automate-condition-field-empty/).

## FAQ

### Is there a round() expression in Power Automate?

Not in the Math group. Use formatNumber() with int() or float(), or use arithmetic with div() and mod().

### How do I round to 2 decimals in Power Automate?

Write float(formatNumber(value, '0.00')). The inner call returns text with two decimals and float() makes it a number.

### Does formatNumber() return text or a number?

It returns text. Wrap it in int() or float() when a later step needs a number.

### How do I round up in Power Automate?

For a positive number, subtract mod(value, 1) and add one when mod(value, 1) is more than zero. Test with your own values.

## Sources

- [How to round a number in Power Automate (Manuel T. Gomes)](https://manueltgomes.com/microsoft/power-platform/powerautomate/how-to-round-a-number/)
- [Rounding Numbers in Power Automate (Stoneridge Software)](https://stoneridgesoftware.com/rounding-numbers-in-power-automate/)
- [Reference guide to workflow expression functions (Microsoft Learn)](https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference)

## Related guides

- [Power Automate: Convert Text to a Number](/guides/power-automate-convert-text-to-number-int-float/)
- [Power Automate: Format a Number as Currency With formatNumber()](/guides/power-automate-format-number-as-currency/)
- [Fix "Invalid type. Expected String but got Null" in Power Automate](/guides/power-automate-invalid-type-expected-string-but-got-null/)
- [Power Automate condition to check if a field is empty](/guides/power-automate-condition-field-empty/)

Source: https://250highstreet.com/guides/power-automate-round-a-number/
