I set quantity, price, total datatype be decimal(10,2) in mysql
When I insert 2, 12, 24 to that table, it shows Data truncated for column 'quantity' at row 1.
Why is it?
I set quantity, price, total datatype be decimal(10,2) in mysql
When I insert 2, 12, 24 to that table, it shows Data truncated for column 'quantity' at row 1.
Why is it?
because 2 is an integer not a decimal.
I set the data type to be float(10,2) and it is ok
Roger Ramjet;10894987 wrote:because 2 is an integer not a decimal.
But that doesn't require truncation. I'm confused, I get no such error from pgsql doing this.
Techissue2008, just FYI, decimal / numeric types are exact types, while floating points are inexact / approximation types. i.e. 1.111 may not get stored as exactly that, but 1.11099999 or something like that.