You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### What problem were solved in this pull request?
Problem: ref #296
double_to_str 函数中使用print %.2f 并不会将浮点数四舍五入,导致测试时与MySQL浮点数四舍五入后结果不同。
### What is changed and how it works?
先进行四舍五入,然后使用 %.2f 转换为字符串
Enhancement
MySQL中对float类型的数据计算总是出现让人无法接受的误差。
样例1:
比如在表中执行:
insert into t values(29.14);
select * from t where id < 29.14;
将会看到29.14这条数据。
样例2:
插入稍微大一点的数字,比如10365.23,MySQL中查询数据时会得到10365.2
The text was updated successfully, but these errors were encountered: