Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ext/intl/formatter/formatter.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ void formatter_register_constants( INIT_FUNC_ARGS )
FORMATTER_EXPOSE_CLASS_CONST( DURATION );
FORMATTER_EXPOSE_CLASS_CONST( PATTERN_RULEBASED );
FORMATTER_EXPOSE_CLASS_CONST( IGNORE );

#if U_ICU_VERSION_MAJOR_NUM >= 53
FORMATTER_EXPOSE_CLASS_CONST( CURRENCY_ACCOUNTING );
#endif
FORMATTER_EXPOSE_CUSTOM_CLASS_CONST( "DEFAULT_STYLE", UNUM_DEFAULT );

/* UNumberFormatRoundingMode */
Expand Down
14 changes: 14 additions & 0 deletions ext/intl/tests/bug78912.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Request #78912 (INTL Support for accounting format)
--SKIPIF--
<?php
if (!extension_loaded('intl')) die('skip intl extension not available');
if (version_compare(INTL_ICU_VERSION, '53.0') < 0) die('skip for ICU >= 53.0');
?>
--FILE--
<?php
$nf = new NumberFormatter('en_US', NumberFormatter::CURRENCY_ACCOUNTING);
var_dump($nf->formatCurrency(-12345.67, 'USD'));
?>
--EXPECT--
string(12) "($12,345.67)"