I
I
idenba2020-04-11 13:12:22
MySQL
idenba, 2020-04-11 13:12:22

What type in the database will allow you to write a number greater than 999.999?

There is a price field in the database, if I set the type to float(7,4) , then the payment above 999.999 does not go through: "the amount does not match", if I change the type to decimal, then if the number is not an integer, but for example 10 rubles 54 kopecks, then five payment does not go through: "the amount does not match"
How to solve?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dr. Bacon, 2020-04-11
@bacon

decimal is needed, but for storing money in float, they kick.

R
Roman Mirilaczvili, 2020-04-11
@2ord

For money, the Float type cannot be used.
The Decimal type must be used correctly, taking into account the fractional part.
What does DECIMAL (MySql) data/field type mean?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question