Fixed-Point types (exact value)-decimal, numeric
Decimal (M, d)
The decimal and numeric types store exact numeric data values.These types are used when it is important to preserve (SAVE) exact precision (precision), for example with
There are non-standard data types such as float,double in MySQL, as well as standard data types such as decimal. The difference is that non-standard types, such as float,double, hold approximate values in db, while decimal saves values as strings.
Copy Code code as follows:
SELECT FORMAT (12562.6655,2);
Result: 12,562.67
Viewing documents: Formats The number X to a format like ' #,###,###.## ', rounded to D decimal places, and returns the result as a string . If D is 0, the
In MySQL data types, such as INT, FLOAT, DOUBLE, CHAR, and DECIMAL, they all have their respective functions, next we will mainly introduce the role and usage of the DECIMAL type in the MySQL data type.
Generally, the value of the floating point
The problem of formatting the floating-point number, using Format (col,2) to retain the two-bit decimal point, there is a problem, such as the following statement, after we give a workaroundSELECT FORMAT (12562.6655,2);Results: 12,562.67View
Mysql format decimal point bitsCN.com
Today, I encountered a problem about formatting floating point numbers. I used format (col, 2) to keep two decimal places.
Select format (12562.6655, 2 );Result: 12,562.67
View document: Formats the number X to
Chapter 23. Precision mathTable of contents
23.1. Types of numeric values23.2. decimal data type changes23.3. Expression handling23.4. Rounding Behavior23.5. Precision math examplesMySQL 5 introduces precision math, that is, numeric value handling
See: http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt336A real number is one with a fractional part. However, they are not just for storing fractional parts, but they can also be usedDeclmal stores an integer larger than the bigint. MySQL
Single-precision floating-point number with 4 bytes (32bit) for floating-point numbers, using the IEEE754 standard computer floating-point number, in the interior is a binary representation, such as: 7.22 with 32-bit binary is not the case, so it
PHP function Chapter Details decimal, binary, octal, and 16 conversion Functions description font: [Increase decrease] type: Reprint
Chinese character coding Research series The first, the PHP function of the decimal, binary, octal and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.