February 2018
Intermediate to advanced
510 pages
16h 10m
English
Fixed point types represent numbers with a fixed number of digits after the decimal or radix point. MySQL has DECIMAL and NUMERIC as fixed point, or exact, value data types. These values are stored in a binary format. Fixed point data types are useful, especially in storing monetary values in multiplication and division operations. The value of a fixed point data type is an integer number scaled by a specific factor, according to the type. For example, the value of 1.11 can be represented in fixed point as 111, with a scaling factor of 1/100. Similarly, 1,110,000 can be represented as 1110, with a scaling factor of 1000.
The following code block demonstrates the declaration of a DECIMAL data type:
CREATE TABLE taxes(tax_rate ...
Read now
Unlock full access