1. Go to this page and download the library: Download jmencoder/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/ */
jmencoder / numero-a-letras example snippets
use jmencoder\NumerosALetras\NumerosALetras;
$converter = new NumerosALetras();
echo $converter->toWords($number, $decimals,$text);
$converter = new NumerosALetras();
echo $converter->toInvoice($number, $decimals, $currency);
$converter = new NumerosALetras();
$converter->suppress = true;
$converter = new NumerosALetras();
$converter->anexar = 'Y';
$converter = new NumerosALetras();
echo $converter->toWords(1500);
//MIL QUINIENTOS
$converter = new NumerosALetras();
echo $converter->toWords(101,0,"MESES");
//CIENTO UNO MESES
$converter = new NumerosALetras();
$converter->suppress = true;
echo $converter->toWords(101,0,"MESES");
//CIENTO UN MESES
$converter = new NumerosALetras();
echo $converter->toInvoice(1200.50, 2, 'dolares');
//MIL DOSCIENTOS DOLARES CON 50/100
$converter = new NumerosALetras();
$converter->currencyPosition = 'after';
echo $converter->toInvoice(1200.50, 2, 'dolares');
//MIL DOSCIENTOS CON 50/100 DOLARES
$converter = new NumerosALetras();
$converter->currencyPosition = 'after';
$converter->anexar = 'Y';
echo $converter->toInvoice(1200.50, 2, 'dolares');
//MIL DOSCIENTOS Y 50/100 DOLARES
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.