GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  LINGUA::EN::WORDS2NUMS (3)

.ds Aq ’

NAME

Lingua::EN::Words2Nums - convert English text to numbers

CONTENTS

SYNOPSIS



 use Lingua::EN::Words2Nums;
 $num=words2nums("two thousand and one");
 $num=words2nums("twenty-second");
 $num=words2nums("15 billion, 6 million, and ninteen");



DESCRIPTION

This module converts English text into numbers. It supports both ordinal and cardinal numbers, negative numbers, and very large numbers.

The main subroutine, which is exported by default, is words2nums(). This subroutine, when fed a string, will attempt to convert it into a number. If it succeeds, the number will be returned. If it fails, it returns undef.

VARIABLES

There are a number of variables that can be used to tweak the behavior of this module. For example, debugging can be be enabled by setting $Lingua::EN::Words2Nums::debug=1
$Lingua::EN::Words2Nums::debug Default: 0. If set to a true value, outputs on standard error some useful messages if parsing fails for some reason.
$Lingua::EN::Words2Nums::billion Default: 10 ** 9. This is the number that will be returned for one billion. It defaults to the American version; the English will want to set it to 10 ** 12. Setting this number automatically changes all the larger numbers (trillion, quadrillion, etc) to match.

NOTES

It does not understand decimals or fractions, yet.

Scores are supported, eg: four score and ten. So are dozens. So is a baker’s dozen. And a gross.

Various mispellings of numbers are understood.

While it handles googol correctly, googolplex is too large to fit in perl’s standard scalar type, and inf will be returned.

AUTHOR

Copyright 2001-2003 Joey Hess <joey@kitenet.net>

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WORDS2NUMS (3) 2008-12-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.