grapefrukt
grapefrukt

Reputation: 27045

What is the best datatype for currencies in MySQL?

I want to store values in a bunch of currencies and I'm not too keen on the imprecise nature of floats. Being able to do math on them directly in queries is also a requirement.

Is Decimal the way to go here?

Upvotes: 13

Views: 4594

Answers (1)

bobwienholt
bobwienholt

Reputation: 17610

Decimal is the best way to go.

You can still do math within the queries.

Upvotes: 17

Related Questions