Mysql method of retaining three decimal places: first open and run the [mysql -uroot -p] command to enter mysql; then execute [select format (decimal, 2)] to retain 2 decimal places; finally run sql You can keep 2 decimal places and round.
The operating environment of this tutorial: windows7 system, mysql8.0.22 version, thinkpad t480 computer.
Related free learning recommendations: mysql video tutorial
Mysql method of retaining three decimal places:
1. Open and run interface, enter the cmd command, as shown in the figure below
#2. Enter the mysql -uroot -p
command to enter mysql, as shown in the figure below
3. If decimals are not processed in mysql, they will be output as is, as shown in the figure below
4. Next Execute select format (decimal, 3) to retain 3 decimal places, as shown in the figure below
5. Run sql to retain 3 decimal places and round off , as shown in the figure below
6. Finally, writing 3 in the second parameter means retaining 3 decimal places, as shown in the figure below
Related free learning recommendations: php programming (video)
The above is the detailed content of How to keep three decimal places in mysql. For more information, please follow other related articles on the PHP Chinese website!