Number.RoundTowardZero

Number

Truncates a number toward zero to the specified number of decimal places, always rounding toward zero regardless of the fractional part.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

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

Parameters

NameTypeRequiredDescription
numbernumberYesThe number to truncate.
digitsnumberNoThe number of decimal places to keep. Defaults to 0 (truncate to integer).

Return Value

numberThe number truncated toward zero to the specified decimal places.

Remarks

Number.RoundTowardZero truncates the fractional part of a number, always moving the result toward zero (never away from zero). For positive numbers, this is equivalent to Number.RoundDown (floor). For negative numbers, it is equivalent to Number.RoundUp (ceiling) — -3.9 truncates to -3, not -4.

This contrasts with Number.RoundDown, which always rounds toward negative infinity: Number.RoundDown(-3.9) = -4, while Number.RoundTowardZero(-3.9) = -3.

No tie-breaking rule applies — the fractional portion is simply discarded regardless of its magnitude (so 3.1 and 3.9 both become 3). This makes Number.RoundTowardZero useful for:

- Strict truncation: retaining only complete units (e.g., full days, full units) without ever inflating values - Integer part extraction: equivalent to Number.IntegerDivide(x, 1) for unit truncation - Decade/bucket bucketing: Number.RoundTowardZero(age / 10) * 10 gives the decade bracket

The optional digits parameter specifies how many decimal places to preserve after truncation.

Examples

Example 1: Truncate a positive number to integer

Result
Result
13

Example 2: Truncate a negative number toward zero (not toward -∞)

Result
Result
1-3

Example 3: Truncate to 2 decimal places

Result
Result
11.99

Example 4: Bucket salary into decade bracket for each employee

Table.AddColumn(
    Table.SelectColumns(Table.FirstN(Employees, 3), {"FullName", "Salary"}),
    "SalaryBracket",
    each Number.RoundTowardZero([Salary] / 10000) * 10000,
    type number
)
Result
FullName
Salary
SalaryBracket
1alice smith55,00050,000
2BOB JONES95,00090,000
3Charlie Brown72,00070,000

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks