# Number.RoundTowardZero

Number.RoundTowardZero is a Power Query M function that rounds a given number based on its sign, rounding positive numbers down and negative numbers up, with support for optional digits parameter. The function returns the rounded number.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

## Syntax

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

## Description

Returns the result of rounding `number` based on the sign of the number. This function will round positive numbers down and negative numbers up. If `digits` is specified, `number` is rounded to the `digits` number of decimal digits.

## Examples

Round the number -1.2 toward zero.

``````// Output: -1
Number.RoundTowardZero( -1.2 )``````

Round the number 1.2 toward zero.

``````// Output: 1
Number.RoundTowardZero( 1.2 )``````

Round the number -1.234 to two decimal places toward zero.

``````// Output: -1.23
Number.RoundTowardZero( -1.234, 2 )``````

Other functions related to Number.RoundTowardZero are:

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/number-roundtowardzero
{"ft_lang_label":"__label__en","ft_lang_prob":0.671553,"math_prob":0.9555093,"size":1011,"snap":"2023-40-2023-50","text_gpt3_token_len":235,"char_repetition_ratio":0.19463754,"word_repetition_ratio":0.027210884,"special_character_ratio":0.22453018,"punctuation_ratio":0.16931216,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98438925,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-11-30T16:35:47Z\",\"WARC-Record-ID\":\"<urn:uuid:8405a265-d9e6-49ea-bb91-e67130fed97b>\",\"Content-Length\":\"329060\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7cde1d62-6680-4833-8ebd-7f04754052ae>\",\"WARC-Concurrent-To\":\"<urn:uuid:b322df78-7850-44f1-a31c-914849bc843f>\",\"WARC-IP-Address\":\"104.18.119.61\",\"WARC-Target-URI\":\"https://powerquery.how/number-roundtowardzero/\",\"WARC-Payload-Digest\":\"sha1:RVVWCSAUO7YXGJZNV6HPJCSNXCFRLWTR\",\"WARC-Block-Digest\":\"sha1:JMTRH34TLWT6XSWZAMYEADU4J5USHNG4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100229.44_warc_CC-MAIN-20231130161920-20231130191920-00304.warc.gz\"}"}