PHP Classes

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

Recommend this page to a friend!
  Info   View files Example   View files View files (33)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 59%Total: 601 All time: 5,180 This week: 105Up
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  
Name: Haseeb Ahmad Basil is available for providing paid consulting. Contact Haseeb Ahmad Basil .
Classes: 11 packages by
Country: Pakistan Pakistan
Age: 26
All time rank: 6147 in Pakistan Pakistan
Week rank: 45 Up1 in Pakistan Pakistan Up
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  
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

  Files folder image Files  /  Numbers  
File Role Description
Files folder imageLocale (16 files, 8 directories)
  Plain text file Words.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  
File Role Description
Files folder imageen (4 files)
Files folder imagees (3 files)
Files folder imagefr (1 file)
Files folder imagehu (1 file)
Files folder imageit (1 file)
Files folder imagept (1 file)
Files folder imagero (1 file)
Files folder imagetr (1 file)
  Plain text file bg.php Class Class source
  Plain text file cs.php Class Class source
  Plain text file de.php Class Class source
  Plain text file dk.php Class Class source
  Plain text file es.php Class Class source
  Plain text file et.php Class Class source
  Plain text file fr.php Class Class source
  Plain text file he.php Class Class source
  Plain text file id.php Class Class source
  Plain text file lt.php Class Class source
  Plain text file lv.php Class Class source
  Plain text file nl.php Class Class source
  Plain text file pl.php Class Class source
  Plain text file ru.php Class Class source
  Plain text file sv.php Class Class source
  Plain text file ua.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  en  
File Role Description
  Plain text file 100.php Class Class source
  Plain text file GB.php Class Class source
  Plain text file IN.php Class Class source
  Plain text file US.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  es  
File Role Description
  Plain text file AR.php Class Class source
  Plain text file MX.php Class Class source
  Plain text file VE.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  fr  
File Role Description
  Plain text file BE.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  hu  
File Role Description
  Plain text file HU.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  it  
File Role Description
  Plain text file IT.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  pt  
File Role Description
  Plain text file BR.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  ro  
File Role Description
  Plain text file RO.php Class Class source

  Files folder image Files  /  Numbers  /  Locale  /  tr  
File Role Description
  Plain text file TR.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:601
This week:0
All time:5,180
This week:105Up
 User Ratings  
 
 All time
Utility:89%StarStarStarStarStar
Consistency:85%StarStarStarStarStar
Documentation:-
Examples:67%StarStarStarStar
Tests:-
Videos:-
Overall:59%StarStarStar
Rank:1234