Sql database column type decimal

Hello,

I want to use three digit money input after the dot
type of column: DECIMAL, 6,3
Sample:
0.000
but after 999.000 the database gives an error
What am I supposed to do with the length of this? “DECIMAL, 6.3”

Wouldn’t DECIMAL, 7, 3 work or something like that?

The decimal column type has a strictly defined size for performance reasons. If you know the largest number you’re going to be storing, just define the column with that length. You can go up to DECIMAL(65, 3).

Yes, it works, I understood the logic later I set it to 19.3 thank you

Now I understand the logic better
Thank you so much

Sponsor our Newsletter | Privacy Policy | Terms of Service