Query: numfmt_parse
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
NUMFMT_PARSE(3) 1 NUMFMT_PARSE(3) NumberFormatter::parse - Parse a number Object oriented styleSYNOPSISpublic mixed NumberFormatter::parse (string $value, [int $type], [int &$position])DESCRIPTIONProcedural style mixed numfmt_parse (NumberFormatter $fmt, string $value, [int $type], [int &$position]) Parse a string into a number using the current formatter rules.PARAMETERSo $fmt -NumberFormatter object. o $type - The formatting type to use. By default, NumberFormatter::TYPE_DOUBLE is used. o $position - Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended.RETURN VALUESThe value of the parsed number or FALSE on error.EXAMPLESExample #1 numfmt_parse(3) example <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL ); $num = "1.234.567,891"; echo numfmt_parse($fmt, $num)." "; echo numfmt_parse($fmt, $num, NumberFormatter::TYPE_INT32)." "; ?> Example #2 OO example <?php $fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL ); $num = "1.234.567,891"; echo $fmt->parse($num)." "; echo $fmt->parse($num, NumberFormatter::TYPE_INT32)." "; ?> The above example will output: 1234567.891 1234567SEE ALSOnumfmt_get_error_code(3), numfmt_format(3), numfmt_parse_currency(3). PHP Documentation Group NUMFMT_PARSE(3)
Related Man Pages |
---|
numfmt_format_currency(3) - php |
numfmt_get_text_attribute(3) - php |
numfmt_parse_currency(3) - php |
numfmt_set_pattern(3) - php |
numfmt_set_text_attribute(3) - php |
Similar Topics in the Unix Linux Community |
---|
PHP help |
for command |
sed coding |
Awk Command help |
How to parse nested variable |