NAME

Data::Validate::Currency - Module to validate if string is a valid currency format

SYNOPSIS

use strict;
use warnings;

use Data::Validate::Currency qw( is_currency );

my $currency_string = '$1,000.00';
my $currency_validation = is_currency($currency_string);

print "Is a valid currency string\n" if $currency_validation;

DESCRIPTION

Module that takes a string and returns a true or false value if the string
is a valid currency. Supports the comma as thousands-separator format,
2 and 3 digit decimals. Dollar sign is optional.

METHODS

is_currency

use strict;
use warnings;
use Data::Validate::Currency qw(is_currency);

my $currency_string = '$1,000.00';
my $currency_validation = is_currency($currency_string);

Returns 1 if it is valid currency format, 0 if it is not. Dollar sign optional.

Author

Daniel Culver, perlsufi@cpan.org

ACKNOWLEDGEMENTS

Eris Caffee, eris-caffee@eldalin.com - A majority of the credit goes to Eris for the final regex.

Robert Stone, drzigman@cpan.org - Robert initially started the regex.

HostGator

COPYRIGHT

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.