Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does mysql keep three decimal places

2025-03-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report