Get the App
SLTechnology News&Howtos  ›  Database  › 

How does mysql keep three decimal places

Shulou Source: shulou.com Published: 2022-06-01 01:42:44 10月03日 Update

This article mainly introduces how to retain three decimal places in mysql, which has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

Mysql's method of keeping three decimal places: first open and run the [mysql-uroot-p] command to enter mysql; and then execute [select format (decimal, 2)] to retain 2 decimal places; finally, run sql to retain 2 decimal places and round them up.

Mysql's method of keeping three decimal places:

1. Open the running interface and enter the cmd command, as shown in the following figure

2. Enter the mysql-uroot-p command to enter mysql, as shown in the following figure

3. If the decimal number is not processed in mysql, the output will be the same, as shown in the following figure.

4. Then execute select format (decimal, 3) to retain 3 decimal places, as shown in the following figure

5. Run sql to retain 3 decimal places and round them, as shown in the following figure

6. Write 3 in the second parameter to retain 3 decimal places, as shown in the following figure

Thank you for reading this article carefully. I hope it is helpful for everyone to share how mysql retains three decimal places. At the same time, I also hope you can support us, pay attention to the industry information channel, and find out if you have any problems. Detailed solutions are waiting for you to learn!

Tags: Decimal run command method article input rounding rounding small and medium representative value content as is parameters at the same time friends interface ribbon industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Linux Redmi OPPO Reno NVidia