PHPackages                             xarenisoft/numbertowords-esp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xarenisoft/numbertowords-esp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xarenisoft/numbertowords-esp
============================

Convierte un número o cadena numerica a su valor correspondiente en palabras.

1.1.2(1y ago)0742MITPHPPHP &gt;=5.4

Since Nov 20Pushed 1y agoCompare

[ Source](https://github.com/DanNYSPD/numero-a-letras)[ Packagist](https://packagist.org/packages/xarenisoft/numbertowords-esp)[ Docs](https://github.com/DanNYSPD/numero-a-letras)[ RSS](/packages/xarenisoft-numbertowords-esp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Numero A Letras
===============

[](#numero-a-letras)

Convierte un número o cadena numerica a su valor correspondiente en palabras. Es un fork de

Instalación
-----------

[](#instalación)

Agrega `xarenisoft/numbertowords-esp` a tu archivo composer.json.

```
    {
        "require": {
            "xarenisoft/numbertowords-esp": "1.0.0"
        }
    }
```

firma del metodo:
-----------------

[](#firma-del-metodo)

```
convertir(string $number,string $moneda = '',string $centimos = '',string $suffix='', int $flags = 0):string
```

Parametros
----------

[](#parametros)

#### number.

[](#number)

Numero o cadena numerica a convertir en palabras

#### moneda

[](#moneda)

moneda en texto que se agregara al final de la parte entera del valor numerico. Por ejemplo: PESOS

#### centimos

[](#centimos)

Si es indicado, es la parte centimos de la moneda, ejemplos son CENTAVOS, si no es especificado este valor o es cadena vacia se usa el formato ##/100

#### suffix

[](#suffix)

Sufijo , por defecto se agrega al final de la cadena solo cuando el formato es ##/100, se puede cambiar este comportamiento usando las banderas del ultimo parametro.

#### flags

[](#flags)

banderas para cambiar el comportamiento del metodo

Uso
---

[](#uso)

```
use Xarenisoft\NumberToWords\Esp\NumeroALetras;
$letras = NumeroALetras::convertir(12345);
//Tambien es posible recibir cadenas numericas

echo  NumeroALetras::convertir("121,311,321.21",'PESOS','CENTAVOS');
//CIENTO VENTIUN MILLONES TRESCIENTOS ONCE MIL TRESCIENTOS VENTIUN PESOS 21/100
echo NumeroALetras::convertir("$ 121,311,321.21",'PESOS','CENTAVOS');
//CIENTO VENTIUN MILLONES TRESCIENTOS ONCE MIL TRESCIENTOS VENTIUN PESOS 21/100
echo NumeroALetras::convertir("$-12131321.21",'PESOS','CENTAVOS');
//MENOS DOCE MILLONES CIENTO TREINTA Y UN MIL TRESCIENTOS VENTIUN PESOS CON VENTIUN CENTAVOS
```

Ademas de elegir los separadores y simbolo de moneda:

```
NumeroALetras::$currencySymbol='€';
NumeroALetras::$thousandSeparator='.';
NumeroALetras::$decimalSeparator=',';
echo NumeroALetras::convertir("12.345,67 €",'EUROS','','EUR');
//DOCE MIL TRESCIENTOS CUARENTA Y CINCO EUROS 67/100 EUR
```

Incluso haciendo uso de currencySymbol, se puede aceptar el siguiente formato:

```
NumeroALetras::$currencySymbol='MXN';
echo NumeroALetras::convertir("-12131321.21 MXN",'PESOS','CENTAVOS');
//MENOS DOCE MILLONES CIENTO TREINTA Y UN MIL TRESCIENTOS VENTIUN PESOS CON VENTIUN CENTAVOS
```

Configurando metodo con flags:

```
//forzando representar centimos cuando es cero:
NumeroALetras::convertir("121,311,321.0",'PESOS','','M.N.',NumeroALetras::FORZAR_CENTIMOS);
//CIENTO VENTIUN MILLONES TRESCIENTOS ONCE MIL TRESCIENTOS VENTIUN PESOS 00/100 M.N.

//forzando usar sufijo a pesar de que el formato es CENTAVOS
NumeroALetras::convertir("121,311,321.21",'PESOS','CENTAVOS','MXN',NumeroALetras::FORZAR_CENTIMOS|NumeroALetras::SUFFIX_SIEMPRE);
//CIENTO VENTIUN MILLONES TRESCIENTOS ONCE MIL TRESCIENTOS VENTIUN PESOS CON VENTIUN CENTAVOS MXN',
```

\##Excepciones La excepcion InvalidArgumentException es arrojada si el numero/cadena numerica excede los centenares de millon

Créditos
--------

[](#créditos)

Basado en la clase para PHP [AxiaCore/numero-a-letras](https://github.com/AxiaCore/numero-a-letras/blob/master/php/NumberToLetterConverter.class.php)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~598 days

Total

4

Last Release

570d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c88bb9614ad980d664e393284ce1b43c8ba4c65554e003c7eb94091778c9bb7?d=identicon)[NYSPD](/maintainers/NYSPD)

---

Top Contributors

[![DanNYSPD](https://avatars.githubusercontent.com/u/21212423?v=4)](https://github.com/DanNYSPD "DanNYSPD (27 commits)")[![arielorozco85](https://avatars.githubusercontent.com/u/220616093?v=4)](https://github.com/arielorozco85 "arielorozco85 (3 commits)")[![arielcr](https://avatars.githubusercontent.com/u/989742?v=4)](https://github.com/arielcr "arielcr (1 commits)")[![GerardoTorres091](https://avatars.githubusercontent.com/u/54483299?v=4)](https://github.com/GerardoTorres091 "GerardoTorres091 (1 commits)")[![manfredjb](https://avatars.githubusercontent.com/u/2416874?v=4)](https://github.com/manfredjb "manfredjb (1 commits)")

---

Tags

letrasconvertirnumero

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xarenisoft-numbertowords-esp/health.svg)

```
[![Health](https://phpackages.com/badges/xarenisoft-numbertowords-esp/health.svg)](https://phpackages.com/packages/xarenisoft-numbertowords-esp)
```

###  Alternatives

[luecano/numero-a-letras

Convierte un número a letras.

78256.1k2](/packages/luecano-numero-a-letras)[phalcon/zephir

Zephir is a compiled high level language aimed to the creation of C-extensions for PHP

3.4k414.1k18](/packages/phalcon-zephir)[wgenial/numeroporextenso

Converte numeral em valor por extenso.

4666.9k](/packages/wgenial-numeroporextenso)[rafaelfragoso/haversini-formula

This PHP class can replace the Google Distance Matrix to calculate the distance between two points using latitude and longitude. It will prevent you to do massive requests to Google servers and enhance your service performance.

45212.0k](/packages/rafaelfragoso-haversini-formula)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
