php man page for numfmt_parse_currency

Query: numfmt_parse_currency

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

NUMFMT_PARSE_CURRENCY(3)						 1						  NUMFMT_PARSE_CURRENCY(3)

NumberFormatter::parseCurrency - Parse a currency number

	Object oriented style

SYNOPSIS
public float NumberFormatter::parseCurrency (string $value, string &$currency, [int &$position])
DESCRIPTION
Procedural style float numfmt_parse_currency (NumberFormatter $fmt, string $value, string &$currency, [int &$position]) Parse a string into a double and a currency using the current formatter.
PARAMETERS
o $fmt -NumberFormatter object. o $currency - Parameter to receive the currency name (3-letter ISO 4217 currency code). o $position - Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended.
RETURN VALUES
The parsed numeric value or FALSE on error.
EXAMPLES
Example #1 numfmt_parse_currency(3) example <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89xc2xa0$"; echo "We have ".numfmt_parse_currency($fmt, $num, $curr)." in $curr "; ?> Example #2 OO example <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89xc2xa0$"; echo "We have ".$fmt->parseCurrency($num, $curr)." in $curr "; ?> The above example will output: We have 1234567.89 in USD
SEE ALSO
numfmt_get_error_code(3), numfmt_parse(3), numfmt_format_currency(3). PHP Documentation Group NUMFMT_PARSE_CURRENCY(3)
Related Man Pages
numfmt_create(3) - php
numfmt_format_currency(3) - php
numfmt_get_error_message(3) - php
numfmt_format(3) - php
numfmt_set_attribute(3) - php
Similar Topics in the Unix Linux Community
How to Parse a CSV file into a Different Format
Regular expressions to check numbers with currency
Finding relative position in a file
Perl: Understanding @allwords
Korn Shell manipulating the string into dynamic currency number