Home  >  Article  >  Database  >  How to use MySQL fixed point numbers

How to use MySQL fixed point numbers

PHPz
PHPzforward
2023-06-02 23:09:49662browse

MySQL fixed-point number

Principle:

Store the integer part and decimal part separately

Syntax:

Decimal(M,D)

Note:

Decimal is variable length, roughly every 9 numbers are stored with 4 bytes, integers and decimals are calculated separately, the maximum M is 65, the maximum D is 30, the default is ( 10,2)

Fixed-point numbers and floating-point numbers support unsigned and display width 0 padding.

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

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete
Previous article:How to use MySQL subqueryNext article:How to use MySQL subquery