| Data::Maker::Field::Currency - A L<Data::Maker> field class used for generating random currency values. |
Data::Maker::Field::Currency - A the Data::Maker manpage field class used for generating random currency values.
use Data::Maker; use Data::Maker::Field::Currency; my $maker = Data::Maker->new( record_count => 10, fields => [ { name => 'price', class => 'Data::Maker::Field::Currency', args => { min => 200, max => 3000, iso_code => 'USD' } } ] );
Data::Maker::Field::Currency is a subclass of the Data::Maker::Field::Number manpage, with the precision attribute set to 2 and the separate_thousands attribute defined as true.
This class also supports the following Moose attributes:
A valid currency code, as defined by ISO 4217. Defaults to USD.
An alias for iso_code
If set to a true value, the generated value will be returned as a float, without any currency formatting.
If set to a true value, the generated value will be returned, prefixed by the country code
John Ingram (john@funnycow.com)
Copyright 2010 by John Ingram. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Data::Maker::Field::Currency - A L<Data::Maker> field class used for generating random currency values. |