SYNOPSIS

     use Parse::Number::ID qw(parse_number_id);
    
     my @a = map {parse_number_id(text=>$_)}
         ("12.345,67", "-1,2e3", "x123", "1.23");
     # @a = (12345.67, -1200, undef, 1.23)

DESCRIPTION

    The goal of this module is to parse/extract numbers commonly found in
    Indonesian text. It currently parses numbers according to Indonesian
    rule of decimal- and thousand separators ("," and "." respectively) as
    well as English ("." and ","), since English numbers are more
    widespread and sometimes mixed within.

     12.3     # 12.3
     12.34    # 12.34
     12.345   # 12345

    In the future this module might also parse fractions (e.g. 1/3, 2 1/2)
    and percentages (e.g. 1,2%).

    This module does not parse numbers that are written as Indonesian
    words, e.g. "seratus dua puluh tiga" (123). See Lingua::ID::Words2Nums
    and Regexp::ID::NumVerbage for that.

VARIABLES

    None are exported by default, but they are exportable.

 $Pat (regex)

    A regex for quickly matching/extracting number from text. It's not 100%
    perfect (the extracted number might not be valid), but it's simple and
    fast.

FAQ

 How does this module differ from other number-parsing modules?

    This module uses a single regex and provides the regex for you to use.
    Other modules might be more accurate and/or faster. But this module is
    pretty fast.

    Also, since English text are often found in Indonesian text, parsing
    English numbers (which uses periods for decimals and commas for
    thousand separators instead of the other way around) is also done, as
    long as it is not ambiguous.

SEE ALSO

    Lingua::ID::Words2Nums

