Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php round function Passing parameters with mode.

<?php
// round to nearest even value
echo(round(10.5,0,PHP_ROUND_HALF_EVEN));
echo "<br>";
 
// round to nearest odd value
echo(round(10.5,0,PHP_ROUND_HALF_ODD));
echo "<br>";
 
// round towards zero
echo(round(10.5,0,PHP_ROUND_HALF_DOWN));
echo "<br>";
 
// round away from zero
echo(round(10.5,0,PHP_ROUND_HALF_UP));
?>
Comment

PREVIOUS NEXT
Code Example
Php :: PHP sha1 — Calculate the sha1 hash of a string 
Php :: why the laravel project have many cache 
Php :: laravel route 
Php :: rodar migration laravel 
Php :: php sentense case 
Php :: Drupal 9 entity.repository load entity by UUID 
Php :: php reload after env 
Php :: php include file from another folder 
Php :: heap sort php 
Php :: how to remove third brackets from encoded json array in php 
Php :: laravel change db connection on the fly 
Php :: php compress csv file 
Php :: laravel firstorcreate usage 
Php :: laravel compare request domain and app domain and request original domain 
Php :: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given 
Php :: laravel collection sort by date 
Php :: php get woocommerce attribute from database 
Php :: wordpress convert object to array 
Php :: change native password in phpmyadmin 
Php :: phpstorm using extract to create variales 
Php :: arry to string php 
Php :: check url parameter if not redirect wordpress plugin 
Php :: laravel translation parameter send 
Php :: square root 
Php :: Web servers supported by php 
Php :: xdebug phpstorm 
Php :: laravel make api resource 
Php :: php print html code 
Php :: laravel faker value or null 
Php :: array_diff php 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =