Updated on 2025-08-14 GMT+08:00

Mathematical Calculation Functions

This section describes mathematical calculation functions, including their syntax, parameters, and usage examples.

Function List

Table 1 Mathematical calculation functions

Function

Description

round

Rounds a number (x). If n is specified, it rounds x to n decimal places. If n is not specified, it rounds x to the nearest integer.

round

This function rounds a number (x). If n is specified, it rounds x to n decimal places. If n is not specified, it rounds x to the nearest integer.

  • Rounds x to the nearest integer:

    Syntax: round(x)

  • Rounds x to n decimal places:

    Syntax: round(x, n)

Table 2 Parameter description

Parameter

Description

Type

Mandatory

x

Original field.

Double

Yes

n

Number of decimal places (integer).

Integer

Yes

Return value type: double

Example: select round(num,4)

Example number: 3.1415926

Table 3 Query and analysis results

Type

Query Statement

Returned Result

Scenario

select round(num,4)

3.1416