1--TEST--
2numfmt_format_currency() icu >= 4.8
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
6--FILE--
7<?php
8
9/*
10 * Format a number using misc currencies/locales.
11 */
12/*
13 * TODO: doesn't pass on ICU 3.6 because 'ru' and 'uk' locales changed
14 * currency formatting.
15 */
16
17
18function ut_main()
19{
20    $locales = array(
21        'en_UK' => 'GBP',
22        'en_US' => 'USD',
23        'ru'    => 'RUR',
24        'uk'    => 'UAH',
25        'en'    => 'UAH'
26    );
27
28    $res_str = '';
29    $number = 1234567.89;
30
31    foreach( $locales as $locale => $currency )
32    {
33        $fmt = ut_nfmt_create( $locale, NumberFormatter::CURRENCY );
34        $res_str .= "$locale: " . var_export( ut_nfmt_format_currency( $fmt, $number, $currency ), true ) . "\n";
35    }
36    return $res_str;
37}
38
39include_once( 'ut_common.inc' );
40
41// Run the test
42ut_run();
43
44?>
45--EXPECT--
46en_UK: '£1,234,567.89'
47en_US: '$1,234,567.89'
48ru: '1 234 567,89 р.'
49uk: '1 234 567,89 ₴'
50en: 'UAH1,234,567.89'
51