php – 为什么我的浮点数在MYSQL中以大于1的形式存储为.9999?
发布时间:2020-12-13 18:28:22 所属栏目:PHP教程 来源:网络整理
导读:我将处理时间作为float(4,4)存储在 MySQL数据库中. $start_time = microtime( TRUE );// things happen in my script$end_time = microtime( TRUE );$process_time = $end_time - $start_time;// insert $process time into mysql table $process_time总是在
我将处理时间作为float(4,4)存储在
MySQL数据库中.
$start_time = microtime( TRUE ); // things happen in my script $end_time = microtime( TRUE ); $process_time = $end_time - $start_time; // insert $process time into mysql table $process_time总是在输出到命令行时正确显示,但是如果它的值大于1,它将以mysql存储为.9999. 是什么赋予了?
float(4,4)表示总共4位数,其中4位在小数点后面.
所以你必须改为10,4例如
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |