user1178246
user1178246

Reputation: 11

Size for my Double type

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

Answers (2)

juergen d
juergen d

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

Omesh
Omesh

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

Related Questions