mySql  round function

the mysql round function is used to round a numeric field to the number of decimals specified.

mysql round() syntax

         select    round(column_name , decimals)    from   table_name;
parameterdescription
column_namerequired.the field to round.
decimalsrequired.specifies the number of decimals to be returned.

this demo database table use in the below mysql round function example

below is a selection from the "users" table:

useridfirstnamelastnamesalarybonus
1sandeepkumar10,0001000
2ankitkumar20,0002000
3ramnehra30,0003000
4vikashnehra12,0002000

mysql round function example

               
    select    round(salary,0)   as  round_value    from    users;

output :

round_value
10,000
20,000
30,000
12,000