Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
 
PREVIOUS NEXT
Tagged: #php #values #array
ADD COMMENT
Topic
Name
9+6 =