angeldanielperegrino/numbers2wordsmx

It spells numbers (and currencies)!

2.3.8 2016-11-18 22:56 UTC

This package is not auto-updated.

Last update: 2025-05-05 16:59:40 UTC


README

numbers2words (ADECUACION PARA MEXICO PESOS, EJEMPLO DOS MIL QUINIENTOS VEITE PESOS 87/100 M.N.)

BASADO EN EL PAQUETE DE jurchiks/numbers2words

This library is meant for general-purpose number spelling for use in, e.g. legal documents and bills.

Supported languages (ISO 639-1 language codes):

  • English ('en')
  • Estonian ('et')
  • Latvian ('lv')
  • Lithuanian ('lt')
  • Russian ('ru')
  • Spanish ('es')

Supported currencies (ISO 4217 currency codes):

  • British Pounds ('GBP')
  • Euro ('EUR')
  • Latvian Lats ('LVL')
  • Lithuanian Lits ('LTL')
  • Russian Roubles ('RUR')
  • U.S. Dollars ('USD')

Report issues if you find any!

Usage:

use js\tools\numbers2wordsmx\Speller;

Speller::spellNumber(123, Speller::LANGUAGE_RU);
// output: сто двадцать три
Speller::spellCurrency(123.45, Speller::LANGUAGE_ENGLISH, Speller::CURRENCY_EURO, true, true);
// output: one hundred and twenty three euro and forty five cents