Re: Additional Rounding modes for the round() function

From: Date: Mon, 04 Jan 2016 17:12:01 +0000
Subject: Re: Additional Rounding modes for the round() function
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-89995@lists.php.net to get a copy of this message
Hi Mark, Mark Baker wrote:
I'd like to suggest a couple of additional options for the round() function, two new flags for PHP_ROUND_UP and PHP_ROUND_DOWN; which are similar to the existing ceil() and floor() functions, but allow a precision argument as well. The PR is at https://github.com/php/php-src/pull/1658
This seems like a sensible addition. That said, I'm not sure about those names, I think they might get confused with PHP_ROUND_HALF_UP/DOWN. Perhaps name them PHP_ROUND_CEIL and PHP_ROUND_FLOOR, or so? Or PHP_ROUND_ALWAYS_UP/DOWN? Not sure if it matters. Thanks! -- Andrea Faulds https://ajf.me/

« previous php.internals (#89995) next »