1.0.3 • Published 10 months ago

numwriter v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

numwriter

Convert numbers and dates in their writen form. Numwriter supports Portuguese-BR, Spanish and English.

Installing

npm install numwriter

Definitions

locales = 'pt-BR' | 'en-US' | 'es-ES'

currency = 'BRL' | 'DOL' | 'PESO' | 'EUR'

How to use it

Numbers or Currency

import { write } from 'numwriter'

write(320);
// returns 'three hundred twenty'

write(320, { locale: 'pt-BR' });
// returns 'trezentos e vinte'

write(320.50, { currency: 'DOL' });
// returns 'three hundred twenty dollars and fifty cents'

write(320.50, { currency: 'EUR', locale: 'es-ES' });
// returns 'trecientos y veinte euros y cincuenta cents'

Dates

import { writeDate } from 'numwriter'

writeDate('2024-10-11');
// returns 'october 11th, 2024'

writeDate('2024-10-11', { locale: 'pt-BR' });
// returns '11 de outubro de 2024'
 
writeDate('2024-10-11', { locale: 'es-ES' })
// returns '11 de octubre de 2024'
1.0.3

10 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago