1--TEST--
2numfmt_parse_currency()
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7
8/*
9 * Currency parsing.
10 */
11
12function ut_main()
13{
14    $res_str = '';
15
16    $fmt = ut_nfmt_create( "en_US", NumberFormatter::CURRENCY );
17    $pos = 0;
18    $currency = '';
19    $num = ut_nfmt_parse_currency( $fmt, '$9,988,776.65', $currency, $pos );
20    $res_str .= "$num $currency\n";
21
22    $fmt = ut_nfmt_create( "en_US", NumberFormatter::CURRENCY );
23    $pos = 1;
24    $currency = '';
25    $num = ut_nfmt_parse_currency( $fmt, ' $123.45', $currency, $pos );
26    $res_str .=  "$num $currency\n";
27
28    return $res_str;
29}
30
31include_once( 'ut_common.inc' );
32ut_run();
33
34?>
35--EXPECT--
369988776.65 USD
37123.45 USD
38