PrefaceDuring the development process, we often use the decimal data type. Because decimal is an accurate data type in MySQL. The data types in MySQL include: float, double and other imprecise data types and decimal, which are precise data types. Difference: For float, double and other inexact types, approximate values are stored in the DB. Decimal stores the exact original value in the form of a string. Introduction to decimal: decimal(a,b) Where: a specifies the maximum number of decimal digits that can be stored to the left and right of the decimal point, with a maximum precision of 38. b specifies the maximum number of decimal digits that can be stored to the right of the decimal point. The number of decimal places must be a value between 0 and a. The default number of decimal places is 0. Note: DECIMAL data types are used in calculations that require very high precision. These types allow the precision and counting method of the values to be specified as selection parameters. Precision here refers to the total number of significant digits stored for the value, while the count method indicates the number of digits after the decimal point. question When the length of the decimal type is less than 14, when inserting data into the decimal type field, the invalid decimal 0 will be automatically removed. Only when the length of the decimal type is greater than or equal to 14 digits, the invalid 0 in the decimal place will be retained and the decimal places will be automatically filled. Notice When the page is displayed, the data also needs to be formatted (decimal places), otherwise invalid 0s will be removed. This is the end of this article about the detailed explanation of the decimal padding problem of the decimal data type in MySQL. For more relevant MySQL decimal padding content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Windows Server 2016 Quick Start Guide to Deploy Remote Desktop Services
>>: Two ways to add a mask effect to the background image using background-color through CSS
Preface mysqlslap is a diagnostic program designe...
Before CSS3, gradient images could only be used a...
Table of contents 1. Scopes are expressed in diff...
The event scheduler in MySQL, EVENT, is also call...
Vue router transitions are a quick and easy way t...
The Internet is an organism that is constantly ev...
I would like to share the installation and config...
There are many MySQL variables, some of which are...
Linux online installation related commands: yum i...
Table of contents The concept of affairs The stat...
Table of contents Written in front Several storag...
Simple example of adding and removing HTML nodes ...
0x0 Test Environment The headquarters production ...
1. Display the files or directories in the /etc d...
The general way of writing is as follows: XML/HTM...