1. Go to this page and download the library: Download luecano/numero-a-letras library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
luecano / numero-a-letras example snippets
use Luecano\NumeroALetras\NumeroALetras;
$formatter = new NumeroALetras();
echo $formatter->toWords($number, $decimals);
$formatter = new NumeroALetras();
echo $formatter->toMoney($number, $decimals, $currency, $cents);
$formatter = new NumeroALetras();
echo $formatter->toString($number, $decimals, $whole_str, $decimal_str);
$formatter = new NumeroALetras();
echo $formatter->toInvoice($number, $decimals, $currency);
$formatter = new NumeroALetras();
$formatter->apocope = true;
$formatter = new NumeroALetras();
$formatter->conector = 'Y';
$formatter = new NumeroALetras();
echo $formatter->toWords(1100);
//MIL CIEN
$formatter = new NumeroALetras();
$formatter->apocope = true;
echo $formatter->toWords(101) . ' AÑOS';
//CIENTO UN AÑOS
$formatter = new NumeroALetras();
echo $formatter->toMoney(2500.90, 2, 'DÓLARES', 'CENTAVOS');
//DOS MIL QUINIENTOS DÓLARES CON NOVENTA CENTAVOS
$formatter = new NumeroALetras();
echo $formatter->toMoney(10.10, 2, 'SOLES', 'CENTIMOS');
//DIEZ SOLES CON DIEZ CENTIMOS
$formatter = new NumeroALetras();
$formatter->conector = 'Y';
echo $formatter->toMoney(11.10, 2, 'pesos', 'centavos');
//ONCE PESOS Y DIEZ CENTAVOS
$formatter = new NumeroALetras();
echo $formatter->toInvoice(1700.50, 2, 'soles');
//MIL SETECIENTOS CON 50/100 SOLES
$formatter = new NumeroALetras();
echo $formatter->toString(5.2, 1, 'años', 'meses');
//CINCO AÑOS CON DOS MESES
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.