Number.Round

This function returns the rounded result of a given number to the nearest whole number. If the number is null, the function will return null as well. By default, the number is rounded to the nearest i...

Syntax

Number.Round(number as nullable number, optional digits as nullable number, optional roundingMode as nullable number) as nullable number

About

This function returns the rounded result of a given number to the nearest whole number. If the number is null, the function will return null as well. By default, the number is rounded to the nearest integer, and ties are resolved by rounding to the nearest even number using the "banker's rounding" method. To customize the rounding behavior, two optional parameters can be used: - Digits: Specify the number of decimal digits to round the number to. - RoundingMode: Override the default tie-breaking method by choosing from different rounding modes defined in RoundingMode.Type.

Explanation

Example 1 Approximate 1.234 to the closest whole number. Usage: In Power Query M, use the function Number.Round(1.234). Output: 1 Example 2 Approximate 1.56 to the closest whole number. Usage: In Power Query M, use the function Number.Round(1.56). Output: 2 Example 3 Round 1.2345 to two decimal places. Usage: In Power Query M, use the function Number.Round(1.2345, 2). Output: 1.23 Example 4 Round 1.2345 to three decimal places (Rounding up). Usage: In Power Query M, use the function Number.Round(1.2345, 3, RoundingMode.Up). Output: 1.235 Example 5 Round 1.2345 to three decimal places (Rounding down). Usage: In Power Query M, use the function Number.Round(1.2345, 3, RoundingMode.Down). Output: 1.234