Template::Plugin::Lingua::EN::Numbers - TT2 interface to Lingua::EN::Numbers module
[% USE Lingua.EN.Numbers -%] [% checksum = content FILTER num2en -%] [% checksum = content FILTER num2en_ordinal -%] [% checksum = content FILTER year2en -%] [% checksum = content FILTER ordinate -%] [% checksum = content.num2en -%] [% checksum = content.num2en_ordinal -%] [% checksum = content.year2en -%] [% checksum = content.ordinate -%]
The Lingua::EN::Numbers Template Toolkit plugin provides access to the Lingua::EN::Numbers, Lingua::EN::Numbers::Years and Lingua::EN::Numbers::Ordinate module functions, to translate number values to their names.
When you invoke
[% USE Lingua.EN.Numbers %]
the following filters (and vmethods of the same name) are installed into the current context:
num2en
Converts a number (such as 123) into English text (such as "one hundred and twenty-three").
num2en_ordinal
Converts a number into the ordinal form in words, so 54 becomes "fifty-fourth".
year2en
Converts a number (such as 1984) into English text (such as "nineteen eighty-four").
ordinate
Converts a number (such as 3) into ordinal form (such as "3rd").
Lingua::EN::Numbers, Lingua::EN::Numbers::Years, Lingua::EN::Numbers::Ordinate, Template, Template::Plugin
Template::Plugin
Barbie <barbie@cpan.org> 2014
Andrew Ford for writing Template::Plugin::Lingua::EN::Inflect, which inspired this module.
Neil Bowers for taking over Sean M Burke's Lingua::EN::Numbers(::(Years|Ordinate))?, modules, and giving me the idea to add to my new Template Toolkit plugins collection, which I've recently taken over from Andrew Ford.
Copyright (C) 2014-2015 Barbie for Miss Barbell Productions.
This distribution is free software; you can redistribute it and/or modify it under the Artistic Licence v2.
To install Template::Plugin::Lingua::EN::Numbers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::Lingua::EN::Numbers
CPAN shell
perl -MCPAN -e shell install Template::Plugin::Lingua::EN::Numbers
For more information on module installation, please visit the detailed CPAN module installation guide.