Number.RoundTowardZero

This function returns the rounded result of a number based on its sign. It rounds positive numbers downward and negative numbers upward. If a specific number of decimal digits is indicated, the number...

Syntax

Number.RoundTowardZero(number as nullable number, optional digits as nullable number) as nullable number

About

This function returns the rounded result of a number based on its sign. It rounds positive numbers downward and negative numbers upward. If a specific number of decimal digits is indicated, the number will be rounded to that specified number of digits.

Explanation

Example 1 Change the number -1.2 to the closest whole number towards zero. Usage: In Power Query M, use the function Number.RoundTowardZero(-1.2). Output: -1 Example 2 Change the number 1.2 to the closest whole number towards zero. Usage: In Power Query M, use the function Number.RoundTowardZero(1.2). Output: 1 Example 3 Change the number -1.234 to two decimal places towards zero. Usage: In Power Query M, use the function Number.RoundTowardZero(-1.234, 2). Output: -1.23