trunc and round function in sql

后端 未结 2 406
你的背包
你的背包 2021-01-19 18:06

Is trunc and round the same with negative arguments?

       SQL> select round(123456.76,-4) from dual;

        ROUND(123456.76,-4)
         -------------         


        
2条回答
  •  情书的邮戳
    2021-01-19 18:38

    ROUND is related to round figure of given value.

    TRUNC is related to truncation of given values.

    In round case of given example, four places till 4th place prior to decimal point padded with 0.

    But in trunc case, four places till 4th place prior to decimal point replacd with 0.

提交回复
热议问题