What is the best datatype for currencies in MySQL?

佐手、 提交于 2019-12-30 06:01:37

问题


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:


Decimal is the best way to go.

You can still do math within the queries.



来源:https://stackoverflow.com/questions/248512/what-is-the-best-datatype-for-currencies-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!