最好的货币MySQL数据类型是什么?What is the best datatype for currencies in MySQL?

- 此内容更新于:2014-12-30
主题:

我想将值存储在一群货币和我不太热衷于漂浮的不精确的性质。能够直接在查询中做数学也是一个要求。 是十进制的方法吗?

原文:

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?

解决方案:
十进制是最好的路要走。 你仍然可以在查询做数学题。
原文:

Decimal is the best way to go.

You can still do math within the queries.