MySQL中货币的最佳数据类型是什么?

时间:2022-02-02 06:41:00

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?

十进制是去往这里的方式吗?

1 个解决方案

#1


17  

Decimal is the best way to go.

十进制是最好的方法。

You can still do math within the queries.

您仍然可以在查询中进行数学运算。

#1


17  

Decimal is the best way to go.

十进制是最好的方法。

You can still do math within the queries.

您仍然可以在查询中进行数学运算。