This tool spells out whole numbers in Portuguese (por extenso) with the gender, hundreds, and connector rules that trip up naive converters. It also switches cleanly between European and Brazilian forms, which differ both in the teens and in the names of the large scales.
How it works
The number is split into three-digit groups from the right. Each group is read
with its hundreds, tens, and units, joined internally by e. Then the groups
are combined with scale words (mil, milhão, bilhão and so on) and the
inter-group e rule:
123 -> cento e vinte e três
200 (f) -> duzentas
1000 -> mil (not "um mil")
1200 -> mil e duzentos
1230 -> mil duzentos e trinta
2 000 000 -> dois milhões
Only the lowest group takes the gender you select; higher groups read in the masculine, because the scale words themselves are masculine.
European versus Brazilian
Switch on European Portuguese to get dezasseis, dezassete, and dezanove
in the teens, and the long-scale large numbers: mil milhões for 10^9 and
bilião for 10^12. Brazilian Portuguese keeps dezesseis and the short scale,
where bilhão already means 10^9. The default sentence settings are masculine
and Brazilian; flip the gender for feminine nouns such as duas cadeiras or
duzentas páginas.