Skip to main content

Name

ec_trunc — round toward zero

Synopsis

ec_trunc { number }

Description

ec_trunc rounds the given number toward 0.

$a = 65.43;
$b = -41.65;
$c = 43;
$trunca = ec_trunc $a;
$truncb = ec_trunc $b;
$truncc = ec_trunc $c;
#trunca is 65.000000
#truncb is -41.000000
#truncc is 43.000000
Was this page helpful?