Reputation: 11
Hy,
I want that one of my columns in my product table stands for totalPrice. Which size of double type is recommended?
Upvotes: 1
Views: 10095
Reputation: 204766
You shoud use a fixed point type for that like:
numeric(10,2)
These types are used when it is important to preserve exact precision, for example with monetary data.
See MySQL Doc
Upvotes: 3
Reputation: 29091
You can use any data type values of your choice in DECIMAL
datatype of MySQL e.g.
DECIMAL(19,4)
As suggested by @stb Best data type for storing currency values in a MySQL database
Upvotes: 1