mirror of
https://github.com/php/php-src.git
synced 2026-04-25 08:58:28 +02:00
505cc77cbe
We provide `NumberFormatter::CURRENCY_ACCOUNTING` to wrap `UNUM_CURRENCY_ACCOUNTING `[1]. [1] <https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266dae97cdd7ed612d07d251021c076efb1c5>
15 lines
412 B
PHP
15 lines
412 B
PHP
--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)"
|