更新时间:2023-02-21 16:27:07
实际上,float/double不如十进制精确.对于货币数据,建议使用十进制类型,因此您应该使用:
Actually float/double is not as precise as decimal. For monetary data, the decimal type is recommended, so you should probably use:
$table->decimal(10, 2); // instead of float
阅读此有关详细信息,以及来自MySql的浮动手册.
Read this for some detailed information and float manual from MySql.