Home > Database > Mysql Tutorial > body text

How to use MySQL floating point data type

WBOY
Release: 2023-05-28 10:30:28
forward
1021 people have browsed it

 MySQL floating point data type

Floating point declaration: float(M,D) double(M,D)

Decimal(M,D) M:Total Digits D: Number of decimal places

 mysql>Create table stu(
  num1 float(5,2),
  num2 double(6,1)
  )
Copy after login

MySQL supports scientific notation

mysql>insert  into  stu values(6E-2)
Copy after login

Floating point precision will be lost

Note: Not specified The number of digits, float defaults to 6 digits after the decimal point. Double defaults to 17 bits.

The above is the detailed content of How to use MySQL floating point data type. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!