Answers for "php round all values in array"

PHP
0

php round all values in array

$numbers = array(1.24152,4.34536,6.436377);
//round all numbers to 3rd decimal place
$numbersRounded=array_map(function($v){return round($v,3);}, $numbers);
Posted by: Guest on August-04-2021

Code answers related to "php round all values in array"

Browse Popular Code Answers by Language