private static function roundHalfTowardsZero($amount)
    {
        if (0 <= bccomp($amount, '0', self::BCSCALE)) {
            $result = self::roundHalfDown($amount);
        } else {
            $result = self::roundHalfUp($amount);
        }

        return $result;
    }
private static function roundHalfTowardsZero($amount)
    {
        if (0 <= bccomp($amount, '0', self::BCSCALE)) {
            $result = self::roundHalfDown($amount);
        } else {
            $result = self::roundHalfUp($amount);
        }

        return $result;
    }
private static function roundHalfTowardsZero ( $ amount ) { if ( 0 <= bccomp ( $ amount , '0' , self :: BCSCALE ) ) { $ result = self :: roundHalfDown ( $ amount ) ; } else { $ result = self :: roundHalfUp ( $ amount ) ; } return $ result ; }
If the fraction of the amount is exactly 0.5, then return the amount - 0.5 if the amount is positive, and return
the amount + 0.5 if the amount is negative.

@param string $amount the amount to round

@return string
If the fraction of the amount is exactly 0 . 5 then return the amount - 0 . 5 if the amount is positive and return the amount + 0 . 5 if the amount is negative .