Skip to content

Commit

Permalink
Add ifdef for NumberFormatter::ROUND_HALFODD
Browse files Browse the repository at this point in the history
According to the docs, UNUM_ROUND_HALF_ODD is only available since ICU 69.0. The build on Travis currently fails probably because it uses a lower version.
  • Loading branch information
kocsismate committed Jan 20, 2024
1 parent 31092c2 commit 117b8de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ext/intl/formatter/formatter.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ class NumberFormatter
public const int ROUND_AWAY_FROM_ZERO = UNKNOWN;
/** @cvalue UNUM_ROUND_HALFEVEN */
public const int ROUND_HALFEVEN = UNKNOWN;
#if U_ICU_VERSION_MAJOR_NUM >= 69
/** @cvalue UNUM_ROUND_HALF_ODD */
public const int ROUND_HALFODD = UNKNOWN;
#endif
/** @cvalue UNUM_ROUND_HALFDOWN */
public const int ROUND_HALFDOWN = UNKNOWN;
/** @cvalue UNUM_ROUND_HALFUP */
Expand Down
4 changes: 3 additions & 1 deletion ext/intl/formatter/formatter_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ext/intl/tests/formatter/rounding_modes.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
NumberFormatter: rounding modes
--EXTENSIONS--
intl
--SKIPIF--
<?php if (version_compare(INTL_ICU_VERSION, '69.0') < 0) die('skip for ICU >= 69.0'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
Expand Down

0 comments on commit 117b8de

Please sign in to comment.