Portuguese Number to Words JavaScript
4 Portuguese locales — Brazil, Portugal, Angola, Mozambique.
| Locale | Country | Currency |
|---|---|---|
pt-BR | Brazil | Real |
pt-PT | Portugal | Euro |
pt-AO | Angola | Kwanza |
pt-MZ | Mozambique | Metical |
Install
bash
npm install to-wordsBasic Conversion
js
import { ToWords } from 'to-words';
const tw = new ToWords({ localeCode: 'pt-BR' });
tw.convert(12345); // "Doze Mil Trezentos E Quarenta E Cinco"
tw.convert(1234.56, { currency: true }); // "Mil Duzentos E Trinta E Quatro Reais E Cinquenta E Seis Centavos"FAQ
Q: Is there a difference between pt-BR and pt-PT?
A: Yes — primarily currency and minor spelling conventions.