round function

The round function rounds the value of an input expression to the specified decimal places to the right of the decimal point.

Syntax:

double round(n [, d ])

Semantics:

Example 1 - round function

SELECT round(n,d) FROM Userstocks
Value of n Value of d Output
100.331 2 100.33
100.367 2 100.37
111.567 0.5 112.0
111.567 4 111.567
10.361 0 or not specified 10.0
111.331 -2 100.0
111.331 -4 0.0
-100.331 2 -100.33
-111.331 -2 -100.0