[VOTE] [RFC]

php.internals

Joerg Sowa

2 years ago
Hello internals! I have just opened voting on the RFC to add 4 new rounding modes to round() function. Voting will end November 30th, 00:00 GMT. Link: https://wiki.php.net/rfc/new_rounding_modes_to_round_function Kind regards, Jorg

Ben Ramsey

2 years ago
> On Nov 15, 2023, at 11:25, Jorg Sowa <jorg.sowa@gmail.com> wrote: > > Hello internals! > I have just opened voting on the RFC to add 4 new rounding modes to round() > function. > > Voting will end November 30th, 00:00 GMT. > > Link: > https://wiki.php.net/rfc/new_rounding_modes_to_round_function > > Kind regards, > Jorg
Under Proposal, you have the following two statements:
> • ROUND_TOWARD_ZERO (equivalent of PHP_ROUND_TOWARD_ZERO) alias of ROUND_UP > • ROUND_AWAY_FROM_ZERO (equivalent of PHP_ROUND_AWAY_FROM_ZERO) alias of ROUND_DOWN
However, the documentation for ROUND_UP says, “Rounding mode to round away from zero,” and the documentation for ROUND_DOWN says, “Rounding mode to round towards zero.” So, I think the proposal has the aliases listed backwards. Please clarify if the proposal is correct or this is a typo. Cheers, Ben

Joerg Sowa

2 years ago
Thank you for catching this. This is a mistake that I have just fixed. This part states now:
> ROUND_TOWARD_ZERO (equivalent of PHP_ROUND_TOWARD_ZERO) alias of
ROUND_DOWN <https://www.php.net/manual/en/class.numberformatter.php#numberformatter.constants.round-down>> ROUND_AWAY_FROM_ZERO (equivalent of PHP_ROUND_AWAY_FROM_ZERO) alias of ROUND_UP <https://www.php.net/manual/en/class.numberformatter.php#numberformatter.constants.round-up> I have been caught myself by the vague terms of rounding up and rounding down. Kind regards, Jorg