Skip to main content

Name

ec_nearbyint — round to the nearest integer based on rounding direction

Synopsis

ec_nearbyint { number }

Description

ec_nearbyint rounds the given number to the nearest integer based on rounding direction.

$a = 65.43;
$b = -41.65;
$c = 43;
$nearbyinta = ec_nearbyint $a;
$nearbyintb = ec_nearbyint $b;
$nearbyintc = ec_nearbyint $c;
#nearbyinta is 65.000000
#nearbyintb is -42.000000
#nearbyintc is 43.000000
Was this page helpful?