PHP Classes

Num2Txt: Convert a number to Spanish text

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-03-20 (2 years ago) RSS 2.0 feedNot enough user ratingsTotal: 66 All time: 9,657 This week: 335Up
Version License PHP version Categories
num2txt 1.0.1The PHP License5PHP 5, Text processing, Math
Description Author
This package is specific mainly for applications used in Spain Spain .

This class can convert a number to Spanish text.

It can take a number and returns a text string that spells the number with words in Spanish.

The class can spell a number of less than 1,000,000,000,000 .

  Performance   Level  
Name: Antonio Leiva <contact>
Classes: 2 packages by
Country: Spain Spain

 

Details

Num2Txt

Two simple classes for convert a number to spanish text.

Examples:

C

string txt1 = Alp3476.A2Num2Txt.ToString("3528.25");
Console.WriteLine(txt1);
// tres mil quinientos veintiocho con veinticinco

string txt2 = Alp3476.A2Num2Txt.ToString(123456);
Console.WriteLine(txt2);
// ciento veintitres mil cuatrocientos cincuenta y seis

string txt3 = Alp3476.A2Num2Txt.ToString(-258241.2);
Console.WriteLine(txt3);
// menos doscientos cincuenta y ocho mil doscientos cuarenta y uno con veinte

PHP

include 'Num2Txt.php';

$o = new  \Alp3476\Num2Txt();
echo $o->toString(3527.25) . PHP_EOL;
// tres mil quinientos veintisiete con veinticinco

echo $o->toString(12342245281.890) . PHP_EOL;
// doce mil trescientos cuarenta y dos millones doscientos cuarenta y cinco mil doscientos ochenta y uno con ochenta y nueve

echo $o->toString(0.253) . PHP_EOL;
// cero con veinticinco

Note:

Trim decimals to 2 digits

  Files folder image Files  
File Role Description
Files folder imagec-sharp (1 file)
Files folder imagephp (1 file)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  c-sharp  
File Role Description
  Accessible without login Plain text file Num2Txt.cs Data Auxiliary data

  Files folder image Files  /  php  
File Role Description
  Plain text file Num2Txt.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:66
This week:0
All time:9,657
This week:335Up

For more information send a message to info at phpclasses dot org.