PHP Classes

PHP Number to Text Conversion: Convert numbers to text in English or Spanish

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
Not enough user ratingsTotal: 409 All time: 6,500 This week: 54Up
Version License PHP version Categories
num2text 1.0Freely Distributable5Localization, PHP 5, Text processing
Description 

Author

This package can convert numbers to text in English or Spanish.

It can take a given number and returns a string that spells that numbers with words.

There are two classes: one for converting to English and another to convert to Spanish. The classes can convert numbers of up to decillions.

Picture of kid goth
Name: kid goth <contact>
Classes: 1 package by
Country: Colombia Colombia

 

Example

<?php

require_once './Num2TextEnglish.php';
$objNum2TextEng = new Num2TextEng();

echo
$objNum2TextEng->convertNumber(1000); // The output will be «one thousand»


// =========================

require_once './Num2TextSpanish.php';
$objNum2TextSpa = new Num2Text();

echo
$objNum2TextSpa->convertNumber(1000); // The output will be «mil»


  Files folder image Files (3)  
File Role Description
Accessible without login Plain text file Example.php Example Example of use
Plain text file Num2TextEnglish.php Class Convert number to literal text in english.
Plain text file Num2TextSpanish.php Class Convertir de numero a texto en español.

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  
 0%
Total:409
This week:0
All time:6,500
This week:54Up