Home » Numbers » Numbers_Words
The PEAR Numbers_Words package provides methods for spelling numerals in words.
This package is unmaintained.
Download latest release 0.18.2 (there might be newer Composer installable version)
License: PHP
Description
With Numbers_Words class you can convert numbers
written in arabic digits to words in several languages.
You can convert an integer between -infinity and infinity.
If your system does not support such long numbers you can
call Numbers_Words::toWords() with just a string.
With the Numbers_Words::toCurrency($num, $locale, 'USD') method
you can convert a number (decimal and fraction part) to words with currency name.
The following languages are supported:
* bg (Bulgarian) by Kouber Saparev
* cs (Czech) by Petr 'PePa' Pavel
* de (German) by Piotr Klaban
* dk (Danish) by Jesper Veggerby
* en_100 (Donald Knuth system, English) by Piotr Klaban
* en_GB (British English) by Piotr Klaban
* en_US (American English) by Piotr Klaban
* es (Spanish Castellano) by Xavier Noguer
* es_AR (Argentinian Spanish) by Martin Marrese
* et (Estonian) by Erkki Saarniit
* fr (French) by Kouber Saparev
* fr_BE (French Belgium) by Kouber Saparev and Philippe Bajoit
* he (Hebrew) by Hadar Porat
* hu_HU (Hungarian) by Nils Homp
* id (Indonesian) by Ernas M. Jamil and Arif Rifai Dwiyanto
* it_IT (Italian) by Filippo Beltramini and Davide Caironi
* lt (Lithuanian) by Laurynas Butkus
* nl (Dutch) by WHAM van Dinter
* pl (Polish) by Piotr Klaban
* pt_BR (Brazilian Portuguese) by Igor Feghali
* ro_RO (Romanian) by Bogdan Stancescu
* ru (Russian) by Andrey Demenev
* sv (Swedish) by Robin Ericsson
* tr_TR (Turkish) by Shahriyar Imanov
* ua (Ukrainian) by Andrey Demenev and Vital Leshchyk
Maintainers
- Piotr Klaban (makler) — lead, inactive
- Kouber Saparev (kouber) — lead, inactive
- Igor Feghali (ifeghali) — lead, inactive
- Marcelo Subtil Marcal (msmarcal) — developer, inactive
- Xavier Noguer (xnoguer) — contributor, inactive
- Hadar Porat (hadar_p) — contributor, inactive
Dependencies
Required
- PHP (>= 5.3.2)
- PEAR Installer (>= 1.4.0b1)
- Math_BigInteger
Releases
- 0.18.2 (beta, 2018-02-13)
Release notes
License: PHP
* PR #32: fix "count(): Parameter must be an array or an object that implements Countable" with PHP 7.2
- 0.18.1 (beta, 2014-11-03)
Release notes
License: PHP
* Fixed bug #20435: Missing files in PEAR archive [kouber]
* Fixed French plural handling for "million" and suffixes above [Olivier Brunel] - 0.18.0 (beta, 2014-10-24)
Release notes
License: PHP
* Fixed bug #19453: Incorrect spelling of Hungarian numbers [kouber]
* Fixed bug #19543: Better handling of decimal mark and thousands separators [kouber]
* Fixed bug #19855: Do not emit E_NOTICE when calling toWords() statically [cweiske]
* Fixed pl unicode [Jakub Roszkiewicz]
* Fixed ru_RU currency codes [Vital Leshchyk]
* Fixed tr_TR unicode [Shahriyar Imanov]
* Added en_IN - Indian English [Abhinav Nayak]
* Added lv - Latvian [Andrius]
* Added ro_RO - Romanian [Bogdan Stancescu]
* Added ua - Ukrainian [Vital Leshchyk]
* Unify locale loading code [cweiske]
* Use PEAR class-to-filename convention [cweiske]This release changes class names and locations of locale files.
This is a backwards compatibility break. - 0.16.4 (beta, 2012-03-21)
Release notes
License: PHP
Currency names for Dutch
Re-licensed to PHP 3.01 [ifeghali] - 0.16.3 (beta, 2011-12-10)
Release notes
License: PHP License
QA Release
Bug #12512 Windows incorrect declaration of toWords() in lang.fr.php (and others!) ifeghali
Bug #17373 bug in toWords function for hungarian translation kouber
Bug #17392 bugs in toWords function for hungarian translation ifeghali
Bug #17754 Patch: Using explode instead of split ifeghali
Request #17763 Independent tr_TR Lang support ifeghali
Bug #17794 Patch: avoiding split in es_MX file ifeghali
Bug #18501 incorrect declaration of toWords() in lang.fr.php kouber
Bug #19013 remove error_reporting (for PEAR QA team) ifeghali - 0.16.2 (beta, 2010-05-10)
Release notes
License: PHP License
* Fixed bug #16435 (improper use of substr() in Polish extension);
* Fixed bug #16667 (wrong spelling of 40 in Hungarian extension) (Vlajos);
* Fixed bug #16733 (incorrect rounding of cents);
* Added optional dependency on Math_BigInteger;
* Improved unit tests (Daniel O'Connor). - 0.16.1 (beta, 2009-03-14)
Release notes
License: PHP License
* Clean up package definition and tests;
* Better cast/sanitation of non-integer values;
* Fixed bug #16019 (incorrect trimming of vowels in the Italian extension). - 0.16.0 (beta, 2009-03-10)
Release notes
License: PHP License
* Added numerous language unit tests (Bulgarian, English 100, English GB, English US, French, French Belgium, German, Italian, Portuguese Brazilian);
* Swap all tests to PHPUnit 3;
* Bugs fixed:
- #10744 wrong getLocales() Docblock;
- #14988 bogus non-int parsing;
- #14667 bad trascription for 101 numbers and 102 thousands bug;
- incorrect values for 80 and 81 in French Belgium;
- #15260 uninitialized string offset in Brazilian Portuguese. - 0.15.0 (beta, 2006-06-13)
Release notes
License: PHP License
* New file for Dutch language (Thanks to WHAM van Dinter);
* package.xml updated to version 2.0;
* Bugs fixed:
- #5618 locale name (and file name) for Estonian is changed from ee to et;
- #6654 bug in Russian translation;
* New feature added:
- #7339 new Numbers_Words::getLocales() method is available (Thanks to Bertrand Gugger). - 0.14.0 (beta, 2005-09-18)
Release notes
License: PHP License
Fixed plural of pence (Thanks to Peter Dunham and Rob King). Added toCurrency method to en_GB language file. Fraction part can be written in digits (Thanks to Rob King).
- 0.13.1 (beta, 2005-03-09)
Release notes
License: PHP License
Fixed a problem with no leading zero in fraction of the currency value (reported by geekdom at gmail dot com).
- 0.13.0 (beta, 2005-03-04)
Release notes
License: PHP License
New files for Czech (thanks to Petr 'PePa' Pavel) and Hebrew (thanks to Hadar Porat) languages.
- 0.12.0 (beta, 2005-01-11)
Release notes
License: PHP License
New file for French (Belgium) language (Thanks to Philippe Bajoit).
- 0.11.0 (beta, 2004-10-22)
Release notes
License: PHP License
toCurrencyWords() support in pt_BR translation (Thanks to Mario H.C.T.)
- 0.10.1 (beta, 2004-09-30)
Release notes
License: PHP License
Small bug fix to German translation (the one thousand) (Thanks to neuner at futureweb dot at).
- 0.10.0 (beta, 2004-09-21)
Release notes
License: PHP License
New file for Danish language (Thanks to Jesper Veggerby).
- 0.9.0 (beta, 2004-08-26)
Release notes
License: PHP License
New file for Hungarian language (Thanks to Nils Homp).
- 0.8.1 (beta, 2004-08-09)
Release notes
License: PHP License
Fixed two bugs (missing t in 400, and wrong function call) in Russian translation.
- 0.8 (beta, 2004-06-17)
Release notes
License: PHP License
New file for Lithuanian language. Fixed a class method finding (should work for PHP5 and PHP4 now).
- 0.7.1 (beta, 2004-05-25)
Release notes
License: PHP License
Small bug fix (use toWords instead of towords) for PHP version 5.
- 0.7 (beta, 2004-04-28)
Release notes
License: PHP License
New file for Swedish language. Small fix in fr and bg translations.
- 0.6 (beta, 2004-04-27)
Release notes
License: PHP License
New file for Argentinian Spanish, Russian and Indonesian language.
- 0.5.1 (beta, 2003-12-21)
Release notes
License: PHP License
Small fix to French translation.
- 0.5 (beta, 2003-12-16)
Release notes
License: PHP License
New file for Bulgarian and French language. toCurrency() method in en_US translation.
- 0.4 (beta, 2003-09-30)
Release notes
License: PHP License
New lang files for: ee (Estonian) and it_IT (Italian).
Changes to es (extranous spaces) and Words.php
(trim output, new function toCurrency() for converting currency values). - 0.3.1 (beta, 2002-11-27)
- 0.3 (beta, 2002-11-26)
Release notes
License: PHP License
New lang files for de (German), pt_BR (Brazilian Portuguese), es (Spanish). First PEAR release.
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #1488 | Closed | Bug | 2004-05-24 | towords error on PHP5 | |
| #1765 | Bogus | Bug | 2004-07-01 | toCurrency() Pb with french | |
| #2076 | Closed | Bug | 2004-08-06 | bug in /Words/lang.ru.php | |
| #2411 | Closed | Bug | 2004-09-28 | Wrong spelling in german file | |
| #2560 | Bogus | Bug | 2004-10-18 | missing currencies | |
| #2597 | Closed | Req | 2004-10-23 | Add a CVS link on package info page | |
| #3751 | Closed | Bug | 2005-03-08 | toCurrency incorrectly translates decimal points | |
| #4651 | Closed | Bug | 2005-06-21 | Incorrect suffix toCurrency with GBP | |
| #4652 | Closed | Bug | 2005-06-21 | problem with en_GB locale | |
| #5618 | Closed | Bug | 2005-10-06 | locale name for Estonian is wrong | |
| #6654 | Closed | Bug | 0.14.0 | 2006-02-01 | russian locale - wrong toCurrency |
| #7339 | Closed | Req | 0.14.0 | 2006-04-07 | Numbers Words list of languages |
| #7873 | Duplicate | Bug | 0.14.0 | 2006-06-12 | Wrong number convertation with Russian locale |
| #8623 | Bogus | Bug | 0.15.0 | 2006-09-03 | Hungarian translation |
| #10744 | Closed | Bug | CVS | 2007-04-16 | Docblock for getLocales() is totally wrong |
| #12512 | Closed | Bug | 0.15.0 | 2007-11-23 | incorrect declaration of toWords() in lang.fr.php (and others!) |
| #14272 | No Feedback | Bug | 0.15.0 | 2008-07-01 | italian language problem (error converting millions) |
| #14667 | Closed | Bug | 0.15.0 | 2008-09-19 | bad trascription for 101 numbers and 102 thousands |
| #14746 | Closed | Req | CVS | 2008-10-05 | Swap to PHPUnit 3 |
| #14988 | Closed | Bug | 0.15.0 | 2008-11-10 | Non-int parsing returns bogus result |
| #15145 | Closed | Req | CVS | 2008-11-24 | PHPCS results - 2098 errors and 422 warnings |
| #15146 | Open | Req | CVS | 2008-11-24 | DRY - refactor common, duplicated code |
| #15149 | Closed | Req | CVS | 2008-11-24 | Dramatically increase test coverage |
| #15166 | Open | Req | CVS | 2008-11-26 | Think about generating an E_NOTICE if PHP_INT_SIZE is exceeded |
| #15260 | Closed | Bug | CVS | 2008-12-06 | Uninitialized string offset: 0 /usr/share/php/Numbers/Words/lang.pt_BR.php:248 |
| #16019 | Closed | Bug | CVS | 2009-03-11 | Wrong behavior for the Italian driver |
| #16435 | Closed | Bug | 0.16.1 | 2009-07-14 | improper use of substr() in lang.pl.php |
| #16667 | Closed | Req | 0.16.1 | 2009-10-01 | hungarian 40 is incorrect |
| #16732 | Assigned | Req | 0.16.1 | 2009-10-23 | Charsets/Locale should be handled |
| #16733 | Closed | Bug | 0.16.1 | 2009-10-23 | Integral part treated incorrectly |
| #17373 | Closed | Bug | 0.16.1 | 2010-05-06 | bug in toWords function for hungarian translation |
| #17392 | Closed | Bug | 0.16.2 | 2010-05-12 | bugs in toWords function for hungarian translation |
| #17442 | No Feedback | Req | Unknown | 2010-05-26 | Dutch 'toCurrencyWords' does not exist |
| #17754 | Closed | Bug | SVN | 2010-08-19 | Patch: Using explode instead of split |
| #17763 | Closed | Req | Unknown | 2010-08-20 | tr_TR Lang support |
| #17794 | Closed | Bug | SVN | 2010-08-22 | Patch: avoiding split in es_MX file |
| #18248 | Closed | Bug | 0.16.2 | 2011-02-07 | lithuanian chars are not in UTF-8 |
| #18501 | Closed | Bug | 0.16.2 | 2011-05-03 | incorrect declaration of toWords() in lang.fr.php |
| #19013 | Closed | Bug | SVN | 2011-11-14 | remove error_reporting (for PEAR QA team) |
| #19395 | Suspended | Bug | 0.16.4 | 2012-04-23 | Most Languages Seem to be broken |
| #19453 | Closed | Bug | 0.16.4 | 2012-06-03 | Hungarian language wrong spelling |
| #19543 | Closed | Bug | 2012-08-03 | comma breaks toCurrency | |
| #19855 | Closed | Bug | 2013-03-12 | Undefined property Text_CAPTCHA_Driver_Word::$locale | |
| #19895 | No Feedback | Bug | 0.16.4 | 2013-04-12 | broken digit conversion in lang.tr_TR |
| #20380 | No Feedback | Req | SVN | 2014-08-29 | Add new languages |
| #20435 | Closed | Bug | 0.18.0 | 2014-11-01 | Missing files in PEAR archive |
| #20495 | Open | Bug | SVN | 2015-01-29 | Long-scale naming vs Short-scale naming |
| #20544 | Open | Bug | 0.18.1 | 2015-05-07 | Missing spaces in nl |
| #20953 | No Feedback | Bug | 0.18.1 | 2015-09-30 | Fatal error: Uncaught exception 'Numbers_Words_Exception' with message 'Unable |
| #20954 | Duplicate | Bug | 0.18.1 | 2015-09-30 | Fatal error: Uncaught exception 'Numbers_Words_Exception' with message 'Unable |
| #21226 | Verified | Bug | 0.18.1 | 2017-07-06 | es_AR |