Lingua::EN::Numbers::Years - turn "1984" into "nineteen eighty-four", etc


Lingua-EN-Numbers-Years documentation  | view source Contained in the Lingua-EN-Numbers-Years distribution.

Index


NAME

Top

Lingua::EN::Numbers::Years - turn "1984" into "nineteen eighty-four", etc

SYNOPSIS

Top

  use Lingua::EN::Numbers::Years;

  my $x = 1803;
  print "I'm old!  I was born in ", year2en($x), "!\n";

prints:

  I'm old!  I was born in eighteen oh three!

DESCRIPTION

Top

Lingua::EN::Numbers::Years turns numbers that represent years, into English text. It exports one function, year2en, which takes a scalar value and returns a scalar value. The return value is the English text expressing that year-number; or if what you provided wasn't a number, then it returns undef.

Unless the input is an at-most five-digit integer (with commas allowed), then year2en just returns Lingua::EN::Number::num2en(value), as a reasonable fall-through.

NOTES

Top

This module is necessary because English pronounces year-numbers differently from normal numbers. So the year 1984 was pronounced "nineteen eighty-four", never "one thousand, nine hundred and eighty-four".

This module makes guesses as to how to pronounce year-numbers between ten thousand and a hundred thousand -- so year2num(10191) returns "ten thousand one ninety-one". But clearly these are not established in English usage. Yet.

Note that year2en doesn't try to append "BC" or "AD".

SEE ALSO

Top

Lingua::EN::Numbers

Lingua::EN::WordsToNumbers

COPYRIGHT

Top

AUTHOR

Top

Sean M. Burke, sburke@cpan.org


Lingua-EN-Numbers-Years documentation  | view source Contained in the Lingua-EN-Numbers-Years distribution.