Answer the question
In order to leave comments, you need to log in
What does DECIMAL (MySql) data/field type mean?
I set a field in the database - my_value DECIMAL(11,10). It is necessary to store values of the form 123456789.1234567890
As I understand it, this field should store a value with 11 integer digits and 10 fractional digits.
But this, of course, is not the case. The fractional part is stored, but the whole is not.
What do the numbers in this DECIMAL(11,10) notation even mean?
And why would an entry like DECIMAL(9,10) cause an error
Query error: #1427 - For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'coin_value ').
PS
Answer the question
In order to leave comments, you need to log in
DECIMAL(X,Y)
X - the total number of characters in the number (including the fractional part)
Y - the number of characters in the fractional part
the total (is there not a total?)
For example, in Rails there is an option to determine the number of integers, the number of fractional numbers after the decimal point, the total number of numbers of the input number based on MySql:
precision - determines the number of digits in the number before the decimal point
scale - determines the number of digits in the number after the decimal point
decimal - determines the total number of digits in a number
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question