PHP Classes

PHP Number To Words Conversion: Convert numbers to words in many languages

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 59%Total: 606 All time: 5,160 This week: 51Up
Version License PHP version Categories
numberstowords 1.0.0The PHP License5Localization, PHP 5, Text processing
Description 

Author

This package can convert numbers to words in many languages.

It can take a given number and converts it to a text string spelling the number in one of many supported languages. Currently it supports:

- English
- Spanish
- French
- Hungarian
- Italian
- Portuguese
- Romanian
- Turkish
- Bulgarian
- Czech
- German
- Danish
- Estonian
- French
- Hebrew
- Indonesian
- Lituanian

Innovation Award
PHP Programming Innovation award winner
December 2016
Winner


Prize: One big elePHPant Plush Mascott
Many PHP applications need to spell numbers or money amounts using words in a given language. There are many separate PHP packages to spell numbers in each language.

This package provides a solution that can spell numbers in many idioms including English, Spanish, French, Hungarian, Italian, Portuguese, Romanian, Turkish, Bulgarian, Czech, German, Danish, Estonian, French, Hebrew, Indonesian, and Lituanian.

Manuel Lemos
Picture of Haseeb Ahmad Basil
  Performance   Level  
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

 

Recommendations

What is the best PHP word to number class?
Convert word to number for the dutch language

Example

<?php

include "autoload.php";

// A few Examples


$num = 32432;

$ret = Numbers_Words::toWords($num,"en_GB");

var_dump("British English", $ret);


$ret = Numbers_Words::toWords($num,"nl");

var_dump("Dutch", $ret);


$ret = Numbers_Words::toWords($num,"fr");

var_dump("French", $ret);


$ret = Numbers_Words::toWords($num,"de");

var_dump("German", $ret);


$ret = Numbers_Words::toWords($num,"id");

var_dump("Indonesian", $ret);


$ret = Numbers_Words::toWords($num,"dk");

var_dump("Danish", $ret);


$ret = Numbers_Words::toCurrency($num,"en_US", "USD");

var_dump("American English", $ret);






  Files folder image Files (33)  
File Role Description
Files folder imageNumbers (1 file, 1 directory)
Accessible without login Plain text file autoload.php Aux. Auxiliary script
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:606
This week:0
All time:5,160
This week:51Up
 User Ratings  
 
 All time
Utility:89%StarStarStarStarStar
Consistency:85%StarStarStarStarStar
Documentation:-
Examples:67%StarStarStarStar
Tests:-
Videos:-
Overall:59%StarStarStar
Rank:1257