File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,9 @@ void formatter_register_constants( INIT_FUNC_ARGS )
4949 FORMATTER_EXPOSE_CLASS_CONST ( DURATION );
5050 FORMATTER_EXPOSE_CLASS_CONST ( PATTERN_RULEBASED );
5151 FORMATTER_EXPOSE_CLASS_CONST ( IGNORE );
52-
52+ #if U_ICU_VERSION_MAJOR_NUM >= 53
53+ FORMATTER_EXPOSE_CLASS_CONST ( CURRENCY_ACCOUNTING );
54+ #endif
5355 FORMATTER_EXPOSE_CUSTOM_CLASS_CONST ( "DEFAULT_STYLE" , UNUM_DEFAULT );
5456
5557 /* UNumberFormatRoundingMode */
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Request #78912 (INTL Support for accounting format)
3+ --SKIPIF--
4+ <?php
5+ if (!extension_loaded ('intl ' )) die ('skip intl extension not available ' );
6+ if (version_compare (INTL_ICU_VERSION , '53.0 ' ) < 0 ) die ('skip for ICU >= 53.0 ' );
7+ ?>
8+ --FILE--
9+ <?php
10+ $ nf = new NumberFormatter ('en_US ' , NumberFormatter::CURRENCY_ACCOUNTING );
11+ var_dump ($ nf ->formatCurrency (-12345.67 , 'USD ' ));
12+ ?>
13+ --EXPECT--
14+ string(12) "($12,345.67)"
You can’t perform that action at this time.
0 commit comments