Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,906 questions

51,838 answers

573 users

How to cast (convert) float to int in PHP

1 Answer

0 votes
$n = 681359;
     
echo $n/4 . "<br />";
echo (int)($n/4) . "<br />";
echo intval($n/4) . "<br />";
echo floor($n/4) . "<br />";
echo ceil($n/4) . "<br />";
echo round($n/4) . "<br />";


   
/*
run:
        
170339.75
170339
170339
170339
170340
170340
       
*/

 



answered Apr 5, 2019 by avibootz

Related questions

1 answer 190 views
1 answer 137 views
1 answer 89 views
89 views asked Jun 27, 2022 by avibootz
1 answer 177 views
177 views asked Jan 9, 2022 by avibootz
1 answer 150 views
1 answer 208 views
208 views asked Oct 17, 2020 by avibootz
1 answer 148 views
148 views asked Apr 7, 2021 by avibootz
...