Skip to content

Commit 117b8de

Browse files
committed
Add ifdef for NumberFormatter::ROUND_HALFODD
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.
1 parent 31092c2 commit 117b8de

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

ext/intl/formatter/formatter.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ class NumberFormatter
5050
public const int ROUND_AWAY_FROM_ZERO = UNKNOWN;
5151
/** @cvalue UNUM_ROUND_HALFEVEN */
5252
public const int ROUND_HALFEVEN = UNKNOWN;
53+
#if U_ICU_VERSION_MAJOR_NUM >= 69
5354
/** @cvalue UNUM_ROUND_HALF_ODD */
5455
public const int ROUND_HALFODD = UNKNOWN;
56+
#endif
5557
/** @cvalue UNUM_ROUND_HALFDOWN */
5658
public const int ROUND_HALFDOWN = UNKNOWN;
5759
/** @cvalue UNUM_ROUND_HALFUP */

ext/intl/formatter/formatter_arginfo.h

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/tests/formatter/rounding_modes.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
NumberFormatter: rounding modes
33
--EXTENSIONS--
44
intl
5+
--SKIPIF--
6+
<?php if (version_compare(INTL_ICU_VERSION, '69.0') < 0) die('skip for ICU >= 69.0'); ?>
57
--FILE--
68
<?php
79
ini_set("intl.error_level", E_WARNING);

0 commit comments

Comments
 (0)