您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php中float转int的方法

2024/5/12 8:11:51发布35次查看
php中float转int的方法
使用round(x,prec)方法
参数 描述
x 可选。规定要舍入的数字。
prec 可选。规定小数点后的位数
<?phpecho(round(0.60));echo(round(0.50));echo(round(0.49));echo(round(-4.40));echo(round(-4.60));输出:110-4-5
推荐教程: 《php教程》
以上就是php中float转int的方法的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product