Lingua-RO-Numbers

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

## Lingua::RO::Numbers

Converts numeric values into their Romanian string equivalents and the other way around.

### SYNOPSIS

```perl
use 5.010;
use Lingua::RO::Numbers qw(number_to_ro ro_to_number);

say number_to_ro(315);
  # prints: 'trei sute cincisprezece'

say ro_to_number('trei sute douazeci si cinci virgula doi');
  # prints: 325.2
```

#### OPTIONS

Initializing an object.

```perl
my $obj = Lingua::RO::Numbers->new();
```

is equivalent with:

```perl
my $obj = Lingua::RO::Numbers->new(
                  diacritics          => 1,
                  invalid_number      => undef,
                  negative_sign       => 'minus',
                  decimal_point       => 'virgulă',
                  thousands_separator => '',
                  infinity            => 'infinit',
                  not_a_number        => 'NaN',
          );
```

#### `number_to_ro($number)`

Converts a number to its Romanian string representation.

```perl
# Functional oriented usage
$string = number_to_ro($number);
$string = number_to_ro($number, %opts);

# Object oriented usage
my $obj = Lingua::RO::Numbers->new(%opts);
$string = $obj->number_to_ro($number);

# Example:
print number_to_ro(98_765, thousands_separator => q{,});
  # says: 'nouăzeci și opt de mii, șapte sute șaizeci și cinci'
```

#### `ro_to_number($text)`

Converts a Romanian text into its numeric value.

```perl
# Functional oriented usage
$number = ro_to_number($text);
$number = ro_to_number($text, %opts);

# Object oriented usage
my $obj = Lingua::RO::Numbers->new(%opts);
$number = $obj->ro_to_number($text);

# Example:
print ro_to_number('patruzeci si doi');  # says: 42
```

### INSTALLATION

To install this module, run the following commands:

    perl Build.PL
    ./Build
    ./Build test
    ./Build install

### SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the
perldoc command.

    perldoc Lingua::RO::Numbers

### LICENSE AND COPYRIGHT

Copyright (C) 2013-2018 Daniel "Trizen" Șuteu

This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a



( run in 0.486 second using v1.01-cache-2.11-cpan-98e64b0badf )